Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/framework/audio/common/audiotypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,6 @@ using volume_dbfs_t = db_t;
using gain_t = float;
using balance_t = float;

using TrackSequenceId = int32_t;
using TrackSequenceIdList = std::vector<TrackSequenceId>;

//! NOTE: We are eliminating the concept of a sequence.
//! This is a temporary required for the transitional phase.
static constexpr TrackSequenceId DUMMY_SEQUENCE_ID = 1;

using TrackId = int32_t;
using TrackIdList = std::vector<TrackId>;
using TrackName = std::string;
Expand Down
7 changes: 3 additions & 4 deletions src/framework/audio/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ else()
iaudioengine.h
iaudiosource.h
iclock.h
itracksequence.h
isequenceplayer.h
iengineplayer.h
ifxprocessor.h
ifxresolver.h
isynthesizer.h
Expand Down Expand Up @@ -70,8 +69,8 @@ else()
internal/clock.cpp
internal/clock.h
internal/igetplaybackposition.h
internal/sequenceplayer.cpp
internal/sequenceplayer.h
internal/engineplayer.cpp
internal/engineplayer.h
internal/samplerateconvertor.cpp
internal/samplerateconvertor.h
internal/track.h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
#include "audio/common/audiotypes.h"

namespace muse::audio::engine {
class ISequencePlayer
class IEnginePlayer
{
public:
virtual ~ISequencePlayer() = default;
virtual ~IEnginePlayer() = default;

virtual async::Promise<Ret> prepareToPlay() = 0;

Expand All @@ -53,5 +53,5 @@ class ISequencePlayer
virtual secs_t playbackPosition() const = 0;
virtual async::Channel<secs_t> playbackPositionChanged() const = 0;
};
using ISequencePlayerPtr = std::shared_ptr<ISequencePlayer>;
using IEnginePlayerPtr = std::shared_ptr<IEnginePlayer>;
}
4 changes: 2 additions & 2 deletions src/framework/audio/engine/internal/engineplayback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "clock.h"
#include "eventaudiosource.h"
#include "sequenceplayer.h"
#include "engineplayer.h"

#include "muse_framework_config.h"
#ifdef MUSE_MODULE_AUDIO_EXPORT
Expand All @@ -49,7 +49,7 @@ void EnginePlayback::init()
ONLY_AUDIO_ENGINE_THREAD;

m_clock = std::make_shared<Clock>();
m_player = std::make_shared<SequencePlayer>(this, m_clock);
m_player = std::make_shared<EnginePlayer>(this, m_clock);

audioEngine()->modeChanged().onReceive(this, [this](RenderMode mode) {
m_prevActiveTrackId = INVALID_TRACK_ID;
Expand Down
6 changes: 3 additions & 3 deletions src/framework/audio/engine/internal/engineplayback.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "../iaudioengine.h"
#include "../iaudioengineconfiguration.h"
#include "../iclock.h"
#include "../isequenceplayer.h"
#include "../iengineplayer.h"

#include "track.h"
#include "igettracks.h"
Expand Down Expand Up @@ -103,7 +103,7 @@ class EnginePlayback : public IEnginePlayback, public IGetTracks, public async::
secs_t playbackPosition() const override;
async::Channel<secs_t> playbackPositionChanged() const override;

// 4. Adjust a Sequence output
// 4. Adjust output
RetVal<AudioOutputParams> outputParams(const TrackId trackId) const override;
void setOutputParams(const TrackId trackId, const AudioOutputParams& params) override;
async::Channel<TrackId, AudioOutputParams> outputParamsChanged() const override;
Expand Down Expand Up @@ -151,7 +151,7 @@ class EnginePlayback : public IEnginePlayback, public IGetTracks, public async::
async::Channel<AudioOutputParams> m_masterOutputParamsChanged;

TracksMap m_tracks;
ISequencePlayerPtr m_player = nullptr;
IEnginePlayerPtr m_player = nullptr;
IClockPtr m_clock = nullptr;
TrackId m_prevActiveTrackId = INVALID_TRACK_ID;
std::unordered_set<TrackId> m_tracksToProcessWhenIdle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include "sequenceplayer.h"
#include "engineplayer.h"

#include "audio/common/audiosanitizer.h"

Expand All @@ -31,7 +31,7 @@ using namespace muse::audio;
using namespace muse::audio::engine;
using namespace muse::async;

SequencePlayer::SequencePlayer(IGetTracks* getTracks, IClockPtr clock)
EnginePlayer::EnginePlayer(IGetTracks* getTracks, IClockPtr clock)
: m_getTracks(getTracks), m_clock(clock)
{
m_clock->seekOccurred().onNotify(this, [this]() {
Expand All @@ -54,7 +54,7 @@ SequencePlayer::SequencePlayer(IGetTracks* getTracks, IClockPtr clock)
});
}

async::Promise<Ret> SequencePlayer::prepareToPlay()
async::Promise<Ret> EnginePlayer::prepareToPlay()
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -67,7 +67,7 @@ async::Promise<Ret> SequencePlayer::prepareToPlay()
});
}

void SequencePlayer::play(const secs_t delay)
void EnginePlayer::play(const secs_t delay)
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -77,7 +77,7 @@ void SequencePlayer::play(const secs_t delay)
m_clock->start();
}

void SequencePlayer::seek(const secs_t newPosition, const bool flushSound)
void EnginePlayer::seek(const secs_t newPosition, const bool flushSound)
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -88,7 +88,7 @@ void SequencePlayer::seek(const secs_t newPosition, const bool flushSound)
m_flushSoundOnSeek = true;
}

void SequencePlayer::stop()
void EnginePlayer::stop()
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -97,7 +97,7 @@ void SequencePlayer::stop()
m_notYetReadyToPlayTrackIdSet.clear();
}

void SequencePlayer::pause()
void EnginePlayer::pause()
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -106,7 +106,7 @@ void SequencePlayer::pause()
m_notYetReadyToPlayTrackIdSet.clear();
}

void SequencePlayer::resume(const secs_t delay)
void EnginePlayer::resume(const secs_t delay)
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -116,7 +116,7 @@ void SequencePlayer::resume(const secs_t delay)
m_clock->resume();
}

msecs_t SequencePlayer::duration() const
msecs_t EnginePlayer::duration() const
{
ONLY_AUDIO_ENGINE_THREAD;

Expand All @@ -127,56 +127,56 @@ msecs_t SequencePlayer::duration() const
return m_clock->timeDuration();
}

void SequencePlayer::setDuration(const msecs_t duration)
void EnginePlayer::setDuration(const msecs_t duration)
{
ONLY_AUDIO_ENGINE_THREAD;

m_clock->setTimeDuration(duration * 1000);
}

Ret SequencePlayer::setLoop(const msecs_t fromMsec, const msecs_t toMsec)
Ret EnginePlayer::setLoop(const msecs_t fromMsec, const msecs_t toMsec)
{
ONLY_AUDIO_ENGINE_THREAD;

return m_clock->setTimeLoop(fromMsec * 1000, toMsec * 1000);
}

void SequencePlayer::resetLoop()
void EnginePlayer::resetLoop()
{
ONLY_AUDIO_ENGINE_THREAD;

m_clock->resetTimeLoop();
}

secs_t SequencePlayer::playbackPosition() const
secs_t EnginePlayer::playbackPosition() const
{
ONLY_AUDIO_ENGINE_THREAD;

return microsecsToSecs(m_clock->currentTime());
}

Channel<secs_t> SequencePlayer::playbackPositionChanged() const
Channel<secs_t> EnginePlayer::playbackPositionChanged() const
{
ONLY_AUDIO_ENGINE_THREAD;

return m_clock->timeChanged();
}

PlaybackStatus SequencePlayer::playbackStatus() const
PlaybackStatus EnginePlayer::playbackStatus() const
{
ONLY_AUDIO_ENGINE_THREAD;

return m_clock->status();
}

Channel<PlaybackStatus> SequencePlayer::playbackStatusChanged() const
Channel<PlaybackStatus> EnginePlayer::playbackStatusChanged() const
{
ONLY_AUDIO_ENGINE_THREAD;

return m_clock->statusChanged();
}

void SequencePlayer::seekAllTracks(const msecs_t newPositionMsecs)
void EnginePlayer::seekAllTracks(const msecs_t newPositionMsecs)
{
IF_ASSERT_FAILED(m_getTracks) {
return;
Expand All @@ -189,7 +189,7 @@ void SequencePlayer::seekAllTracks(const msecs_t newPositionMsecs)
}
}

void SequencePlayer::flushAllTracks()
void EnginePlayer::flushAllTracks()
{
IF_ASSERT_FAILED(m_getTracks) {
return;
Expand All @@ -202,7 +202,7 @@ void SequencePlayer::flushAllTracks()
}
}

void SequencePlayer::prepareAllTracksToPlay(AllTracksReadyCallback allTracksReadyCallback)
void EnginePlayer::prepareAllTracksToPlay(AllTracksReadyCallback allTracksReadyCallback)
{
ONLY_AUDIO_ENGINE_THREAD;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#ifndef MUSE_AUDIO_SEQUENCEPLAYER_H
#define MUSE_AUDIO_SEQUENCEPLAYER_H
#ifndef MUSE_AUDIO_ENGINEPLAYER_H
#define MUSE_AUDIO_ENGINEPLAYER_H

#include "global/async/asyncable.h"

#include "modularity/ioc.h"
#include "../iaudioengine.h"

#include "../isequenceplayer.h"
#include "../iengineplayer.h"
#include "../iclock.h"

#include "igettracks.h"

namespace muse::audio::engine {
class SequencePlayer : public ISequencePlayer, public async::Asyncable
class EnginePlayer : public IEnginePlayer, public async::Asyncable
{
GlobalInject<engine::IAudioEngine> audioEngine;

public:
explicit SequencePlayer(IGetTracks* getTracks, IClockPtr clock);
explicit EnginePlayer(IGetTracks* getTracks, IClockPtr clock);

async::Promise<Ret> prepareToPlay() override;

Expand Down Expand Up @@ -76,4 +76,4 @@ class SequencePlayer : public ISequencePlayer, public async::Asyncable
};
}

#endif // MUSE_AUDIO_SEQUENCEPLAYER_H
#endif // MUSE_AUDIO_ENGINEPLAYER_H
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ void EngineRpcController::init()
SaveSoundTrackProgress ch = playback()->saveSoundTrackProgressChanged();
ch.onReceive(this, [this](int64_t current, int64_t total, SaveSoundTrackStage stage) {
ONLY_AUDIO_RPC_THREAD;
m_saveSoundTrackProgressStream.send(DUMMY_SEQUENCE_ID, current, total, stage);
m_saveSoundTrackProgressStream.send(current, total, stage);
});

if (m_saveSoundTrackProgressStreamId == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/framework/audio/engine/internal/enginerpccontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class EngineRpcController : public async::Asyncable
std::map<std::string /*sfname*/, std::vector<PendingTrack> > m_pendingTracks;
bool m_soundFontsChangedSubscribed = false;

async::Channel<TrackSequenceId, int64_t, int64_t, SaveSoundTrackStage> m_saveSoundTrackProgressStream;
async::Channel<int64_t, int64_t, SaveSoundTrackStage> m_saveSoundTrackProgressStream;
rpc::StreamId m_saveSoundTrackProgressStreamId = 0;
};
}
64 changes: 0 additions & 64 deletions src/framework/audio/engine/itracksequence.h

This file was deleted.

Loading
Loading