2 |
// |
// |
3 |
/**************************************************************************** |
/**************************************************************************** |
4 |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. |
5 |
Copyright (C) 2007, Christian Schoenebeck |
Copyright (C) 2007, 2008 Christian Schoenebeck |
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
This program is free software; you can redistribute it and/or |
8 |
modify it under the terms of the GNU General Public License |
modify it under the terms of the GNU General Public License |
25 |
|
|
26 |
#include "qsamplerMainForm.h" |
#include "qsamplerMainForm.h" |
27 |
|
|
28 |
|
#include "qsamplerChannelFxForm.h" |
29 |
|
|
30 |
|
#include <QMessageBox> |
31 |
#include <QDragEnterEvent> |
#include <QDragEnterEvent> |
32 |
#include <QUrl> |
#include <QUrl> |
33 |
|
|
34 |
|
#define MIDI_OFF_COLOR Qt::darkGreen |
35 |
|
#define MIDI_ON_COLOR Qt::green |
36 |
|
|
37 |
// Channel status/usage usage limit control. |
// Channel status/usage usage limit control. |
38 |
#define QSAMPLER_ERROR_LIMIT 3 |
#define QSAMPLER_ERROR_LIMIT 3 |
39 |
|
|
91 |
QObject::connect(m_ui.ChannelEditPushButton, |
QObject::connect(m_ui.ChannelEditPushButton, |
92 |
SIGNAL(clicked()), |
SIGNAL(clicked()), |
93 |
SLOT(channelEdit())); |
SLOT(channelEdit())); |
94 |
|
QObject::connect(m_ui.FxPushButton, |
95 |
|
SIGNAL(clicked()), |
96 |
|
SLOT(channelFxEdit())); |
97 |
|
|
98 |
|
pMidiActivityTimer = new QTimer(this); |
99 |
|
pMidiActivityTimer->setSingleShot(true); |
100 |
|
QObject::connect( |
101 |
|
pMidiActivityTimer, SIGNAL(timeout()), |
102 |
|
this, SLOT(midiDataCeased()) |
103 |
|
); |
104 |
|
|
105 |
|
#if CONFIG_EVENT_CHANNEL_MIDI |
106 |
|
m_ui.MidiActivityLabel->setPalette(MIDI_OFF_COLOR); |
107 |
|
m_ui.MidiActivityLabel->setAutoFillBackground(true); |
108 |
|
#else |
109 |
|
m_ui.MidiActivityLabel->setText("X"); |
110 |
|
m_ui.MidiActivityLabel->setToolTip("MIDI Activity Disabled"); |
111 |
|
#endif |
112 |
|
|
113 |
setSelected(false); |
setSelected(false); |
114 |
} |
} |
237 |
pal.setColor(QPalette::Background, Qt::black); |
pal.setColor(QPalette::Background, Qt::black); |
238 |
} |
} |
239 |
m_ui.ChannelInfoFrame->setPalette(pal); |
m_ui.ChannelInfoFrame->setPalette(pal); |
240 |
|
m_ui.InstrumentNameTextLabel->setPalette(pal); |
241 |
m_ui.StreamVoiceCountTextLabel->setPalette(pal); |
m_ui.StreamVoiceCountTextLabel->setPalette(pal); |
242 |
} |
} |
243 |
|
|
309 |
m_pChannel->editChannel(); |
m_pChannel->editChannel(); |
310 |
} |
} |
311 |
|
|
312 |
|
bool ChannelStrip::channelFxEdit (void) |
313 |
|
{ |
314 |
|
MainForm *pMainForm = MainForm::getInstance(); |
315 |
|
if (!pMainForm || !channel()) |
316 |
|
return false; |
317 |
|
|
318 |
|
pMainForm->appendMessages(QObject::tr("channel fx sends...")); |
319 |
|
|
320 |
|
bool bResult = false; |
321 |
|
|
322 |
|
#if CONFIG_FXSEND |
323 |
|
ChannelFxForm *pChannelFxForm = |
324 |
|
new ChannelFxForm(channel(), parentWidget()); |
325 |
|
if (pChannelFxForm) { |
326 |
|
//pChannelForm->setup(this); |
327 |
|
bResult = pChannelFxForm->exec(); |
328 |
|
delete pChannelFxForm; |
329 |
|
} |
330 |
|
#else // CONFIG_FXSEND |
331 |
|
QMessageBox::critical(this, |
332 |
|
QSAMPLER_TITLE ": " + tr("Unavailable"), |
333 |
|
tr("Sorry, QSampler was built without FX send support!\n\n" |
334 |
|
"(Make sure you have a recent liblscp when recompiling QSampler)")); |
335 |
|
#endif // CONFIG_FXSEND |
336 |
|
|
337 |
|
return bResult; |
338 |
|
} |
339 |
|
|
340 |
// Channel reset slot. |
// Channel reset slot. |
341 |
bool ChannelStrip::channelReset (void) |
bool ChannelStrip::channelReset (void) |
549 |
} |
} |
550 |
} |
} |
551 |
|
|
552 |
|
void ChannelStrip::midiArrived() { |
553 |
|
m_ui.MidiActivityLabel->setPalette(MIDI_ON_COLOR); |
554 |
|
pMidiActivityTimer->start(50); |
555 |
|
} |
556 |
|
|
557 |
// Context menu event handler. |
// Context menu event handler. |
558 |
void ChannelStrip::contextMenuEvent( QContextMenuEvent *pEvent ) |
void ChannelStrip::contextMenuEvent( QContextMenuEvent *pEvent ) |
564 |
m_pChannel->contextMenuEvent(pEvent); |
m_pChannel->contextMenuEvent(pEvent); |
565 |
} |
} |
566 |
|
|
567 |
|
void ChannelStrip::midiDataCeased() { |
568 |
|
m_ui.MidiActivityLabel->setPalette(MIDI_OFF_COLOR); |
569 |
|
} |
570 |
|
|
571 |
// Error count hackish accessors. |
// Error count hackish accessors. |
572 |
void ChannelStrip::resetErrorCount (void) |
void ChannelStrip::resetErrorCount (void) |