summaryrefslogtreecommitdiff
path: root/muse2/muse/confmport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'muse2/muse/confmport.cpp')
-rw-r--r--muse2/muse/confmport.cpp56
1 files changed, 37 insertions, 19 deletions
diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp
index 8b323fc1..42fb5276 100644
--- a/muse2/muse/confmport.cpp
+++ b/muse2/muse/confmport.cpp
@@ -4,6 +4,21 @@
// $Id: confmport.cpp,v 1.9.2.10 2009/12/15 03:39:58 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; version 2 of
+// the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <list>
@@ -115,7 +130,7 @@ void MPConfig::changeDefInputRoutes(QAction* act)
else
chbits = defch ^ (1 << actid);
midiPorts[no].setDefaultInChannels(chbits);
- mdevView->item(item->row(), DEVCOL_DEF_IN_CHANS)->setText(bitmap2String(chbits));
+ mdevView->item(item->row(), DEVCOL_DEF_IN_CHANS)->setText(MusEUtil::bitmap2String(chbits));
}
}
@@ -202,7 +217,7 @@ void MPConfig::changeDefOutputRoutes(QAction* act)
else
chbits = defch ^ (1 << actid);
midiPorts[no].setDefaultOutChannels(chbits);
- mdevView->item(item->row(), DEVCOL_DEF_OUT_CHANS)->setText(bitmap2String(chbits));
+ mdevView->item(item->row(), DEVCOL_DEF_OUT_CHANS)->setText(MusEUtil::bitmap2String(chbits));
#else
if(actid < MIDI_CHANNELS)
{
@@ -211,7 +226,7 @@ void MPConfig::changeDefOutputRoutes(QAction* act)
setPortExclusiveDefOutChan(no, chbits);
int j = mdevView->rowCount();
for(int i = 0; i < j; ++i)
- mdevView->item(i, DEVCOL_DEF_OUT_CHANS)->setText(bitmap2String(i == no ? chbits : 0));
+ mdevView->item(i, DEVCOL_DEF_OUT_CHANS)->setText(MusEUtil::bitmap2String(i == no ? chbits : 0));
if(defpup)
{
QAction* a;
@@ -442,7 +457,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
case DEVCOL_INROUTES:
case DEVCOL_OUTROUTES:
{
- if(!checkAudioDevice())
+ if(!MusEGlobal::checkAudioDevice())
return;
if(audioDevice->deviceType() != AudioDevice::JACK_AUDIO) // Only if Jack is running.
@@ -609,8 +624,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
return;
#else
{
- defpup = new PopupMenu(this, true);
- defpup->addAction(new MenuTitleItem("Channel", defpup));
+ defpup = new MusEWidget::PopupMenu(this, true);
+ defpup->addAction(new MusEWidget::MenuTitleItem("Channel", defpup));
QAction* act = 0;
int chbits = midiPorts[no].defaultInChannels();
for(int i = 0; i < MIDI_CHANNELS; ++i)
@@ -632,7 +647,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
act->setEnabled(!song->midis()->empty()); // && midiPorts[no].device());
connect(defpup, SIGNAL(triggered(QAction*)), SLOT(changeDefInputRoutes(QAction*)));
- //connect(defpup, SIGNAL(aboutToHide()), muse, SLOT(routingPopupMenuAboutToHide()));
+ //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingMusEWidget::PopupMenuAboutToHide()));
//defpup->popup(QCursor::pos());
defpup->exec(QCursor::pos());
delete defpup;
@@ -649,8 +664,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
return;
#else
{
- defpup = new PopupMenu(this, true);
- defpup->addAction(new MenuTitleItem("Channel", defpup));
+ defpup = new MusEWidget::PopupMenu(this, true);
+ defpup->addAction(new MusEWidget::MenuTitleItem("Channel", defpup));
QAction* act = 0;
int chbits = midiPorts[no].defaultOutChannels();
for(int i = 0; i < MIDI_CHANNELS; ++i)
@@ -675,7 +690,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
act->setEnabled(!song->midis()->empty()); // && midiPorts[no].device());
connect(defpup, SIGNAL(triggered(QAction*)), SLOT(changeDefOutputRoutes(QAction*)));
- //connect(defpup, SIGNAL(aboutToHide()), muse, SLOT(routingPopupMenuAboutToHide()));
+ //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingMusEWidget::PopupMenuAboutToHide()));
//defpup->popup(QCursor::pos());
defpup->exec(QCursor::pos());
delete defpup;
@@ -757,7 +772,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
//if(!mapALSA.empty())
{
pup->addSeparator();
- pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup));
+ pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup));
for(imap i = mapALSA.begin(); i != mapALSA.end(); ++i)
{
@@ -783,7 +798,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
if(!mapSYNTH.empty())
{
pup->addSeparator();
- pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup));
+ pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup));
for(imap i = mapSYNTH.begin(); i != mapSYNTH.end(); ++i)
{
@@ -809,7 +824,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
//if(!mapJACK.empty())
{
pup->addSeparator();
- pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup));
+ pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup));
for(imap i = mapJACK.begin(); i != mapJACK.end(); ++i)
{
@@ -884,7 +899,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
}
midiSeq->msgSetMidiDevice(port, sdev);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
song->update();
}
}
@@ -1164,10 +1179,10 @@ void MPConfig::songChanged(int flags)
QTableWidgetItem* itemin = new QTableWidgetItem;
addItem(i, DEVCOL_INROUTES, itemin, mdevView);
itemin->setFlags(Qt::ItemIsEnabled);
- //QTableWidgetItem* itemdefin = new QTableWidgetItem(bitmap2String(port->defaultInChannels()));
+ //QTableWidgetItem* itemdefin = new QTableWidgetItem(MusEUtil::bitmap2String(port->defaultInChannels()));
// Ignore synth devices. Default input routes make no sense for them (right now).
QTableWidgetItem* itemdefin = new QTableWidgetItem((dev && dev->isSynti()) ?
- QString() : bitmap2String(port->defaultInChannels()));
+ QString() : MusEUtil::bitmap2String(port->defaultInChannels()));
addItem(i, DEVCOL_DEF_IN_CHANS, itemdefin, mdevView);
// Enabled: Use editor (not good). Disabled: Use pop-up menu.
#if 0
@@ -1184,12 +1199,12 @@ void MPConfig::songChanged(int flags)
// Turn on if and when multiple output routes are supported.
#if 0
- QTableWidgetItem* itemdefout = new QTableWidgetItem(bitmap2String(port->defaultOutChannels()));
+ QTableWidgetItem* itemdefout = new QTableWidgetItem(MusEUtil::bitmap2String(port->defaultOutChannels()));
addItem(i, DEVCOL_DEF_OUT_CHANS, itemdefout, mdevView);
itemdefout->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled);
#else
//QTableWidgetItem* itemdefout = new QTableWidgetItem(QString("--"));
- QTableWidgetItem* itemdefout = new QTableWidgetItem(bitmap2String(0));
+ QTableWidgetItem* itemdefout = new QTableWidgetItem(MusEUtil::bitmap2String(0));
defochs = port->defaultOutChannels();
if(defochs)
{
@@ -1337,7 +1352,7 @@ void MPConfig::addInstanceClicked()
MidiDevice* dev = port->device();
if (dev==0) {
midiSeq->msgSetMidiDevice(port, si);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
song->update();
break;
}
@@ -1366,6 +1381,8 @@ void MPConfig::removeInstanceClicked()
audio->msgRemoveTrack(*ii);
}
+namespace MusEApp {
+
//---------------------------------------------------------
// configMidiPorts
//---------------------------------------------------------
@@ -1380,3 +1397,4 @@ void MusE::configMidiPorts()
midiPortConfig->activateWindow();
}
+} // namespace MusEApp