Skip to content

Commit

Permalink
Removed seq synth action
Browse files Browse the repository at this point in the history
  • Loading branch information
FangCunWuChang committed Aug 29, 2024
1 parent 77ba7a1 commit 4435578
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 75 deletions.
1 change: 0 additions & 1 deletion app/translates/zh-CN/main.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ countries: cn
"Instrument Offline" = "乐器离线"
"Offline" = "离线"
"Select MIDI Track" = "选择 MIDI 轨道"
"Synth" = "合成"

"Type:" = "类型:"
"Instrument:" = "乐器:"
Expand Down
19 changes: 0 additions & 19 deletions src/audioCore/action/ActionOther.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,25 +360,6 @@ bool ActionSaveMidiSource::doAction() {
return false;
}

ActionSynth::ActionSynth(int index)
: index(index) {}

bool ActionSynth::doAction() {
ACTION_CHECK_RENDERING(
"Don't do this while rendering.");

if (auto graph = AudioCore::getInstance()->getGraph()) {
if (auto track = graph->getSourceProcessor(this->index)) {
track->startSynth();

this->output("Synth: [" + juce::String{ this->index } + "]\n");
return true;
}
}
this->error("Can't synth: [" + juce::String{ this->index } + "]\n");
return false;
}

ActionSplitSequencerBlock::ActionSplitSequencerBlock(
int track, int block, double time)
: ACTION_DB{ track, block, time } {}
Expand Down
16 changes: 0 additions & 16 deletions src/audioCore/action/ActionOther.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,22 +294,6 @@ class ActionSaveMidiSource final : public ActionBase {
JUCE_LEAK_DETECTOR(ActionSaveMidiSource)
};

class ActionSynth final : public ActionBase {
public:
ActionSynth() = delete;
ActionSynth(int index);

bool doAction() override;
const juce::String getName() override {
return "Synth";
};

private:
const int index;

JUCE_LEAK_DETECTOR(ActionSynth)
};

class ActionSplitSequencerBlock final : public ActionUndoableBase {
public:
ActionSplitSequencerBlock() = delete;
Expand Down
8 changes: 0 additions & 8 deletions src/audioCore/command/CommandOther.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,6 @@ AUDIOCORE_FUNC(saveMIDI) {
return CommandFuncResult{ true, "" };
}

AUDIOCORE_FUNC(synth) {
auto action = std::unique_ptr<ActionBase>(new ActionSynth{
(int)luaL_checkinteger(L, 1) });
ActionDispatcher::getInstance()->dispatch(std::move(action));
return CommandFuncResult{ true, "" };
}

void regCommandOther(lua_State* L) {
LUA_ADD_AUDIOCORE_FUNC_DEFAULT_NAME(L, clearPlugin);
LUA_ADD_AUDIOCORE_FUNC_DEFAULT_NAME(L, searchPlugin);
Expand All @@ -177,5 +170,4 @@ void regCommandOther(lua_State* L) {
LUA_ADD_AUDIOCORE_FUNC_DEFAULT_NAME(L, loadMIDI);
LUA_ADD_AUDIOCORE_FUNC_DEFAULT_NAME(L, saveAudio);
LUA_ADD_AUDIOCORE_FUNC_DEFAULT_NAME(L, saveMIDI);
LUA_ADD_AUDIOCORE_FUNC_DEFAULT_NAME(L, synth);
}
13 changes: 0 additions & 13 deletions src/audioCore/graph/SeqSourceProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ SeqSourceProcessor::SeqSourceProcessor(const juce::AudioChannelSet& type)
{ this->audioOutputNode->nodeID, i } });
}

/** TODO Synth Thread */

/** Set Level Size */
this->outputLevels.resize(type.size());

Expand All @@ -65,8 +63,6 @@ void SeqSourceProcessor::updateIndex(int index) {
this->index = index;
this->srcs.updateIndex(index);

/** TODO Synth Index */

/** Callback */
UICallbackAPI<int>::invoke(UICallbackType::SeqChanged, index);
}
Expand Down Expand Up @@ -278,15 +274,6 @@ bool SeqSourceProcessor::getInstrOffline() const {
return this->instrOffline;
}

bool SeqSourceProcessor::isSynthRunning() const {
/** TODO */
return false;
}

void SeqSourceProcessor::startSynth() {
/** TODO */
}

uint64_t SeqSourceProcessor::getAudioRef() const {
return this->audioSourceRef;
}
Expand Down
3 changes: 0 additions & 3 deletions src/audioCore/graph/SeqSourceProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class SeqSourceProcessor final : public juce::AudioProcessorGraph,
void setInstrOffline(bool offline);
bool getInstrOffline() const;

bool isSynthRunning() const;
void startSynth();

uint64_t getAudioRef() const;
uint64_t getMIDIRef() const;

Expand Down
7 changes: 1 addition & 6 deletions src/ui/component/sequencer/SeqTrackComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ void SeqTrackComponent::instrMenuShow() {
}

enum SeqMenuActionType {
Add = 1, Remove1, MIDITrack, Synth
Add = 1, Remove1, MIDITrack
};

void SeqTrackComponent::menuShow() {
Expand All @@ -629,10 +629,6 @@ void SeqTrackComponent::menuShow() {
CoreActions::setSeqMIDITrackGUI(this->index);
break;
}
case SeqMenuActionType::Synth: {
CoreActions::synthSeq(this->index);
break;
}
}
}

Expand Down Expand Up @@ -700,7 +696,6 @@ juce::PopupMenu SeqTrackComponent::createMenu() const {
menu.addItem(SeqMenuActionType::Add, TRANS("Add"));
menu.addItem(SeqMenuActionType::Remove1, TRANS("Remove"));
menu.addItem(SeqMenuActionType::MIDITrack, TRANS("Select MIDI Track"));
menu.addItem(SeqMenuActionType::Synth, TRANS("Synth"));

return menu;
}
Expand Down
5 changes: 0 additions & 5 deletions src/ui/misc/CoreActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,11 +449,6 @@ void CoreActions::setSeqMIDIRef(int index, const juce::String& path,
ActionDispatcher::getInstance()->dispatch(std::move(action));
}

void CoreActions::synthSeq(int index) {
auto action = std::unique_ptr<ActionBase>(new ActionSynth{ index });
ActionDispatcher::getInstance()->dispatch(std::move(action));
}

void CoreActions::removeSeq(int index) {
auto action = std::unique_ptr<ActionBase>(new ActionRemoveSequencerTrack{ index });
ActionDispatcher::getInstance()->dispatch(std::move(action));
Expand Down
1 change: 0 additions & 1 deletion src/ui/misc/CoreActions.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ class CoreActions final {
const std::function<void(uint64_t)>& callback = {});
static void setSeqMIDIRef(int index, const juce::String& path,
bool getTempo, const std::function<void(uint64_t)>& callback = {});
static void synthSeq(int index);
static void removeSeq(int index);

static void addTempoLabel(double time, double tempo);
Expand Down
3 changes: 0 additions & 3 deletions test/testInstr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ AC.setInstrBypass(0, false);
AC.setInstrOffline(0, true);
AC.setInstrOffline(0, false);

-- Synth
AC.synth(0);

-- Instrument Plugin MIDI Channel
AC.setInstrMIDIChannel(0, 0);

Expand Down

0 comments on commit 4435578

Please sign in to comment.