Skip to content

Commit

Permalink
Update CUSTOM10
Browse files Browse the repository at this point in the history
  • Loading branch information
Estwald committed Sep 29, 2023
1 parent 04ab5d2 commit 2383417
Show file tree
Hide file tree
Showing 49 changed files with 3,632 additions and 1,075 deletions.
200 changes: 172 additions & 28 deletions src/VST/VST.cpp

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion src/VST/VST.h
Expand Up @@ -127,6 +127,8 @@ class VSTDialog: public QDialog
QSemaphore *semaf;
bool _dis_change;

bool in_use;

public:
QGroupBox *groupBox;
QSpinBox *SpinBoxPreset;
Expand Down Expand Up @@ -178,7 +180,7 @@ class VST_proc: public QObject
static int VST_unload(int chan);
static void VST_Resize(int chan, int w, int h);
static int VST_exit();
static int VST_mix(float**in, int nchans, int samplerate, int nsamples);
static int VST_mix(float**in, int nchans, int samplerate, int nsamples, int mode = 0);
static int VST_isLoaded(int chan);
static bool VST_mix_disable(bool disable);

Expand Down
1,317 changes: 628 additions & 689 deletions src/fluid/fluidsynth_proc.cpp

Large diffs are not rendered by default.

21 changes: 18 additions & 3 deletions src/fluid/fluidsynth_proc.h
Expand Up @@ -33,6 +33,7 @@
#include <QAudioOutput>
#include <QSettings>
#include "FluidDialog.h"
#include "../midi/MidiFile.h"
#include "../midi/MidiPlayer.h"

#include <QtCore/QVariant>
Expand Down Expand Up @@ -74,6 +75,14 @@ extern QSystemSemaphore *sys_sema_inW;
#define GET_FILTER_GAIN 2
#define GET_FILTER_RES 4

#define PLAYER_STATUS_WAV_ERROR -1
#define PLAYER_STATUS_WAV_INIT 0
#define PLAYER_STATUS_WAV_RUN 1
#define PLAYER_STATUS_WAV_WAIT 3
#define PLAYER_STATUS_WAV_END 2
#define PLAYER_STATUS_WAV_NOTWRITE 4
#define PLAYER_STATUS_WAV_BREAK 666

class PROC_filter;
class fluid_Thread;
class fluid_Input_Thread;
Expand Down Expand Up @@ -107,6 +116,8 @@ class fluidsynth_proc: public QObject
fluidsynth_proc();
~fluidsynth_proc();

static void msDelay(int ms);

ProgressDialog *_bar;
bool wavDIS;

Expand Down Expand Up @@ -283,19 +294,23 @@ class fluid_Thread_playerWAV : public QThread {

int init_sequencer_player();
int sequencer_player();
int sendCommand(MidiEvent*event);
int msOfTick(int tick);
int sendCommand(MidiEvent*event, int ms);

private:
QMultiMap<int, MidiEvent*> * events2;
QMultiMap<int, MidiEvent*> * file_events;

bool lock_audio;

int sequencer_tick_pos;
int sequencer_tick_end;
int sequencer_note_tick_end;
fluid_sequencer_t* sequencer;
fluid_seq_id_t synthSeqID, mySeqID;

fluidsynth_proc *_proc;

QMultiMap<int, MidiEvent*>::iterator it;

signals:
void setBar(int num);
void endBar();
Expand Down
63 changes: 47 additions & 16 deletions src/gui/ChannelListWidget.cpp
Expand Up @@ -49,6 +49,9 @@ ChannelListItem::ChannelListItem(int ch, ChannelListWidget* parent)
layout->setVerticalSpacing(1);

colored = new ColoredWidget(*(Appearance::channelColor(channel)), this);

colored->setToolTip("Double click to show this channel only");

layout->addWidget(colored, 0, 0, 2, 1);

connect(colored, SIGNAL(doubleClick()), this, SLOT(doubleClick()));
Expand All @@ -71,7 +74,12 @@ ChannelListItem::ChannelListItem(int ch, ChannelListWidget* parent)
QToolBar* toolBar = new QToolBar(this);
toolBar->setIconSize(QSize(12, 12));
QPalette palette = toolBar->palette();
palette.setColor(QPalette::Window, Qt::white);
#ifdef CUSTOM_MIDIEDITOR_GUI
// Estwald Color Changes
palette.setColor(QPalette::Background, QColor(0xe0e0c0));
#else
palette.setColor(QPalette::Background, Qt::white);
#endif
toolBar->setPalette(palette);

// visibility
Expand Down Expand Up @@ -165,7 +173,7 @@ ChannelListItem::ChannelListItem(int ch, ChannelListWidget* parent)
layout->addWidget(toolBar, 2, 1, 1, 1);


if(channel < 16 && channel != 9) {
if(channel >= 0 && channel < 16 && channel != 9) {

spinOctave = new QSpinBox(this);
spinOctave->setObjectName(QString::fromUtf8("spinOctave"));
Expand All @@ -183,6 +191,9 @@ ChannelListItem::ChannelListItem(int ch, ChannelListWidget* parent)
else
spinOctave->setStyleSheet(QString::fromUtf8("background-color: #8010f030;"));

if(channel < 0 || channel >= 16)
return;

if(OctaveChan_MIDI[channel] == v) return;

OctaveChan_MIDI[channel] = v;
Expand Down Expand Up @@ -269,6 +280,11 @@ void ChannelListItem::toggleSolo(bool solo)
}
channelList->midiFile()->protocol()->startNewAction(text);
channelList->midiFile()->channel(channel)->setSolo(solo);
for(int n = 0; n < 16; n++) {
if(n == channel)
continue;
channelList->midiFile()->channel(n)->setSolo(false);
}
channelList->midiFile()->protocol()->endAction();
emit channelStateChanged();
}
Expand Down Expand Up @@ -387,11 +403,33 @@ void ChannelListItem::doubleClick()

void ChannelListItem::WidgeUpdate()
{
int v = OctaveChan_MIDI[channel];

int v = (channel >= 0 && channel < 16) ? OctaveChan_MIDI[channel] : 0;
spinOctave->setValue(v);

}

void ChannelListItem::paintEvent(QPaintEvent* event) {
QWidget::paintEvent(event);
#ifdef CUSTOM_MIDIEDITOR_GUI
// Estwald Color Changes
QPainter *p = new QPainter(this);
if(!p) return;

p->fillRect(0, 0, width(), height() - 2, background1);

if(this->channel == 9) {
QColor c(0x80ffff);
c.setAlpha(32);

p->fillRect(0, 0, width(), height() - 2, c);
}
p->end();
delete p;
#endif

}

#ifdef USE_FLUIDSYNTH
void ChannelListWidget::ToggleViewVST(int channel, bool on) {

Expand Down Expand Up @@ -421,11 +459,16 @@ ChannelListWidget::ChannelListWidget(QWidget* parent)
{

setSelectionMode(QAbstractItemView::NoSelection);
#ifdef CUSTOM_MIDIEDITOR_GUI
// Estwald Color Changes
setStyleSheet("QListWidget {background-color: #e0e0c0;} QListWidget::item { border-bottom: 1px solid black;}");
#else
setStyleSheet("QListWidget::item { border-bottom: 1px solid lightGray; }");
#endif

for (int channel = 0; channel < 17; channel++) {
ChannelListItem* widget = new ChannelListItem(channel, this);
QListWidgetItem* item = new QListWidgetItem();
QListWidgetItem* item = new QListWidgetItem();
item->setSizeHint(QSize(0, ROW_HEIGHT));
addItem(item);
setItemWidget(item, widget);
Expand Down Expand Up @@ -483,18 +526,6 @@ void ChannelListWidget::OctaveUpdate()
}

OctaveChan_MIDI[i] = v;

if(0)
if(i < 16 && i != 9 && OctaveChan_MIDI[i] != v) {


emit items.at(i)->spinOctave->valueChanged(v);
//
}




}


Expand Down
3 changes: 3 additions & 0 deletions src/gui/ChannelListWidget.h
Expand Up @@ -82,6 +82,9 @@ public slots:
int channel;
ColoredWidget* colored;
QAction *visibleAction, *loudAction, *soloAction;

protected:
void paintEvent(QPaintEvent* event) override;
};

class ChannelListWidget : public QListWidget {
Expand Down
5 changes: 5 additions & 0 deletions src/gui/ColoredWidget.cpp
Expand Up @@ -31,7 +31,12 @@ void ColoredWidget::paintEvent(QPaintEvent*)

p.begin(this);
p.setRenderHint(QPainter::Antialiasing);
#ifdef CUSTOM_MIDIEDITOR_GUI
// Estwald Color Changes
p.fillRect(0, 0, width(), height(), Qt::transparent /*QColor(0xe0e0d0)*/);
#else
p.fillRect(0, 0, width(), height(), Qt::white);
#endif
p.setPen(Qt::lightGray);
p.setBrush(_color);
p.drawRoundedRect(x, y, l, l, 30, 30, Qt::RelativeSize);
Expand Down

0 comments on commit 2383417

Please sign in to comment.