1 |
/*************************************************************************** |
/*************************************************************************** |
2 |
* * |
* * |
3 |
* Copyright (C) 2007, 2008 Christian Schoenebeck * |
* Copyright (C) 2007 - 2009 Christian Schoenebeck * |
4 |
* * |
* * |
5 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
6 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
30 |
|
|
31 |
InstrumentEditor::InstrumentEditor() : Thread(false, false, -1, 0) { |
InstrumentEditor::InstrumentEditor() : Thread(false, false, -1, 0) { |
32 |
pInstrument = NULL; |
pInstrument = NULL; |
33 |
|
pUserData = NULL; |
34 |
} |
} |
35 |
|
|
36 |
InstrumentEditor::~InstrumentEditor() { |
InstrumentEditor::~InstrumentEditor() { |
37 |
} |
} |
38 |
|
|
39 |
void InstrumentEditor::Launch(void* pInstrument, String sTypeName, String sTypeVersion) { |
void InstrumentEditor::Launch(void* pInstrument, String sTypeName, String sTypeVersion, void* pUserData) { |
40 |
dmsg(1,("InstrumentEditor::Launch(instr=%x,type=%s,version=%s)\n", pInstrument, sTypeName.c_str(), sTypeVersion.c_str())); |
dmsg(1,("InstrumentEditor::Launch(instr=%x,type=%s,version=%s)\n", pInstrument, sTypeName.c_str(), sTypeVersion.c_str())); |
41 |
// prepare the editor's mandatory parameters |
// prepare the editor's mandatory parameters |
42 |
this->pInstrument = pInstrument; |
this->pInstrument = pInstrument; |
43 |
this->sTypeName = sTypeName; |
this->sTypeName = sTypeName; |
44 |
this->sTypeVersion = sTypeVersion; |
this->sTypeVersion = sTypeVersion; |
45 |
|
this->pUserData = pUserData; |
46 |
// start the editor in its own thread |
// start the editor in its own thread |
47 |
StartThread(); |
StartThread(); |
48 |
} |
} |
50 |
int InstrumentEditor::Main() { |
int InstrumentEditor::Main() { |
51 |
dmsg(1,("InstrumentEditor::Main()\n")); |
dmsg(1,("InstrumentEditor::Main()\n")); |
52 |
// run the editor's main loop |
// run the editor's main loop |
53 |
int iResult = Main(pInstrument, sTypeName, sTypeVersion); |
int iResult = Main(pInstrument, sTypeName, sTypeVersion, pUserData); |
54 |
// reset editor parameters |
// reset editor parameters |
55 |
this->pInstrument = NULL; |
this->pInstrument = NULL; |
56 |
this->sTypeName = ""; |
this->sTypeName = ""; |
57 |
this->sTypeVersion = ""; |
this->sTypeVersion = ""; |
58 |
|
this->pUserData = NULL; |
59 |
dmsg(1,("Instrument editor '%s' returned with exit status %d\n", Name().c_str(), iResult)); |
dmsg(1,("Instrument editor '%s' returned with exit status %d\n", Name().c_str(), iResult)); |
60 |
// notify all registered listeners |
// notify all registered listeners |
61 |
std::for_each( |
std::for_each( |