Loading...
Searching...
No Matches
ChangeAudioFile.hpp
1#pragma once
2#include <Media/Commands/MediaCommandFactory.hpp>
3#include <Media/MediaFileHandle.hpp>
4#include <Media/Sound/SoundModel.hpp>
5
6#include <score/command/Command.hpp>
7#include <score/command/PropertyCommand.hpp>
8#include <score/model/path/Path.hpp>
9
10namespace Media
11{
12
13class SCORE_PLUGIN_MEDIA_EXPORT ChangeAudioFile final : public score::Command
14{
15 SCORE_COMMAND_DECL(Media::CommandFactoryName(), ChangeAudioFile, "Change audio file")
16public:
18 const Sound::ProcessModel&, const QString& text,
19 const score::DocumentContext& ctx);
20
22
23 void undo(const score::DocumentContext& ctx) const override;
24 void redo(const score::DocumentContext& ctx) const override;
25
26protected:
27 void serializeImpl(DataStreamInput& s) const override;
28 void deserializeImpl(DataStreamOutput& s) override;
29
30private:
32 QString m_old, m_new;
33 TimeVal m_olddur{};
34 TimeVal m_newdur{};
35 TimeVal m_oldloop{};
36 score::Command* m_resizeInterval{};
37};
38
39class SCORE_PLUGIN_MEDIA_EXPORT LoadProcessedAudioFile final : public score::Command
40{
41 SCORE_COMMAND_DECL(
42 Media::CommandFactoryName(), LoadProcessedAudioFile, "Load processed audio file")
43public:
44 LoadProcessedAudioFile(const Sound::ProcessModel&, const QString& text);
45
46 void undo(const score::DocumentContext& ctx) const override;
47 void redo(const score::DocumentContext& ctx) const override;
48
49protected:
50 void serializeImpl(DataStreamInput& s) const override;
51 void deserializeImpl(DataStreamOutput& s) override;
52
53private:
55 QString m_old, m_new;
56};
57}
58
59PROPERTY_COMMAND_T(Media, ChangeStream, Sound::ProcessModel::p_stream, "Change stream")
60PROPERTY_COMMAND_T(
61 Media, ChangeStart, Sound::ProcessModel::p_startChannel, "Change start channel")
62PROPERTY_COMMAND_T(
63 Media, ChangeUpmix, Sound::ProcessModel::p_upmixChannels, "Change upmix channels")
64PROPERTY_COMMAND_T(
65 Media, ChangeStretchMode, Sound::ProcessModel::p_stretchMode, "Change stretch mode")
66PROPERTY_COMMAND_T(
67 Media, ChangeTempo, Sound::ProcessModel::p_nativeTempo, "Change file tempo")
68SCORE_COMMAND_DECL_T(Media::ChangeStream)
69SCORE_COMMAND_DECL_T(Media::ChangeStart)
70SCORE_COMMAND_DECL_T(Media::ChangeUpmix)
71SCORE_COMMAND_DECL_T(Media::ChangeTempo)
72SCORE_COMMAND_DECL_T(Media::ChangeStretchMode)
Definition ChangeAudioFile.hpp:14
Definition ChangeAudioFile.hpp:40
Definition SoundModel.hpp:27
The Path class is a typesafe wrapper around ObjectPath.
Definition Path.hpp:52
The Command class.
Definition Command.hpp:34
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition TimeValue.hpp:21
Definition DocumentContext.hpp:18