Skip to content

Commit

Permalink
Some Project.toml tweaks and fixes #52
Browse files Browse the repository at this point in the history
  • Loading branch information
ssfrr committed Nov 19, 2019
1 parent be214e2 commit 55845de
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 29 deletions.
21 changes: 11 additions & 10 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@ TreeViews = "a2a6695c-b41b-5b7d-aed9-dbfdeacea5d7"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
Compat = "≥ 0.59.0"
DSP = "≥ 0.4.0"
FFTW = "≥ 0.0.4"
FixedPointNumbers = "≥ 0.4.6"
IntervalSets = "≥ 0.2.0"
Unitful = "≥ 0.8.0"
julia = "≥ 0.6.0"
Compat = "2"
DSP = "0.6.1"
FFTW = "1.1.0"
FixedPointNumbers = "0.6.1"
IntervalSets = "0.3.2"
Unitful = "0.17.0"
julia = "1"

[extras]
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
Gumbo = "708ec375-b3d6-5a57-a7ce-8257bf98657a"
LibSndFile = "b13ce0c6-77b0-50c6-a2db-140568b8d1a5"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
SampledSignals = "bd7594eb-a658-542f-9e75-4c4d8908c167"
TreeViews = "a2a6695c-b41b-5b7d-aed9-dbfdeacea5d7"

[targets]
test = ["LibSndFile", "FileIO", "Unitful", "DSP", "Gumbo", "FixedPointNumbers", "FFTW"]
test = ["DSP", "FileIO", "FixedPointNumbers", "LibSndFile", "Unitful", "Compat", "SampledSignals", "TreeViews"]
4 changes: 2 additions & 2 deletions src/SampleBuf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ function toindex end
toindex(buf::SampleBuf, t::Number) = t
toindex(buf::SampleBuf, t::FrameQuant) = inframes(Int, t) + 1
toindex(buf::SampleBuf, t::Unitful.Time) = inframes(Int, t, samplerate(buf)) + 1
toindex(buf::SampleBuf, t::Quantity) = throw(Unitful.DimensionError(t, s))
toindex(buf::SampleBuf, t::Unitful.AbstractQuantity) = throw(Unitful.DimensionError(t, s))
toindex(buf::SpectrumBuf, f::Number) = f
toindex(buf::SpectrumBuf, f::FrameQuant) = inframes(Int, f) + 1
toindex(buf::SpectrumBuf, f::Unitful.Frequency) = inframes(Int, f, samplerate(buf)) + 1
toindex(buf::SpectrumBuf, f::Quantity) = throw(Unitful.DimensionError(f, Hz))
toindex(buf::SpectrumBuf, f::Unitful.AbstractQuantity) = throw(Unitful.DimensionError(f, Hz))

# indexing by vectors of Quantities not yet supported
toindex(buf::AbstractSampleBuf, I::ClosedInterval{Int}) =
Expand Down
2 changes: 1 addition & 1 deletion src/SampleStream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const DEFAULT_BLOCKSIZE=4096
function Base.write(sink::SampleSink, source::SampleSource, duration::Quantity;
blocksize=-1)
sr = samplerate(sink)
frames = trunc(Int, inseconds(duration) * sr)
frames = trunc(Int, inseconds(duration, sr) * sr)
n = write(sink, source, frames; blocksize=blocksize)

# if we completed the operation return back the original duration so the
Expand Down
4 changes: 2 additions & 2 deletions src/units.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ inframes(time::Unitful.Time, rate) = inseconds(time)*inHz(rate)
inframes(::Type{T}, freq::Unitful.Frequency, rate) where T <: Integer =
round(T, inHz(freq)*inseconds(rate))
inframes(freq::Unitful.Frequency, rate) = inHz(freq)*inseconds(rate)
inframes(::Type, frame::Quantity) = error("Unknown sample rate")
inframes(frame::Quantity) = error("Unknown sample rate")
inframes(::Type, frame::Unitful.AbstractQuantity) = error("Unknown sample rate")
inframes(frame::Unitful.AbstractQuantity) = error("Unknown sample rate")
inframes(::Type{T}, frame::Real) where T = T(frame)
inframes(frame::Real) = frame

Expand Down
7 changes: 0 additions & 7 deletions test/Project.toml

This file was deleted.

7 changes: 0 additions & 7 deletions test/REQUIRE

This file was deleted.

0 comments on commit 55845de

Please sign in to comment.