Skip to content

Commit

Permalink
Added icons for location indicator line
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxras committed Mar 27, 2012
1 parent f9da4fa commit 7b3576f
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 277 deletions.
2 changes: 1 addition & 1 deletion oom/ctrl/ctrlcanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class CtrlCanvas : public View
QRect lasso;
QPoint start;
Tool tool;
unsigned pos[3];
unsigned pos[4];
int curDrumInstrument; //Used by the drum-editor to view velocity of only one key (one drum)

void leaveEvent(QEvent*e);
Expand Down
91 changes: 2 additions & 89 deletions oom/icons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,43 +43,11 @@
#include "xpm/view_marker.xpm"
#include "xpm/view_mixer.xpm"
#include "xpm/view_transport_window.xpm"
/*
#include "xpm/pointer.xpm"
#include "xpm/pencil.xpm"
#include "xpm/delete.xpm"
#include "xpm/play.xpm"
*/
/*
#include "xpm/record1.xpm"
#include "xpm/record.xpm"
#include "xpm/record_on.xpm"
#include "xpm/record_off.xpm"
#include "xpm/stop.xpm"
#include "xpm/start.xpm"
#include "xpm/fforward.xpm"
#include "xpm/frewind.xpm"
#include "xpm/punchin.xpm"
#include "xpm/punchout.xpm"
#include "xpm/punchin1.xpm"
#include "xpm/punchout1.xpm"
#include "xpm/loop1.xpm"
#include "xpm/loop.xpm"
#include "xpm/dot.xpm"
#include "xpm/doth.xpm"
#include "xpm/dot1.xpm"
*/
#include "xpm/note.xpm"
#include "xpm/note1.xpm"
#include "xpm/stick.xpm"
#include "xpm/wave.xpm"
#include "xpm/synth.xpm"
#include "xpm/cmark.xpm"
#include "xpm/lmark.xpm"
#include "xpm/rmark.xpm"
//#include "xpm/cut.xpm"
//#include "xpm/steprec.xpm"
//#include "xpm/glue.xpm"
//#include "xpm/draw.xpm"
#include "xpm/quant.xpm"
#include "xpm/fileprint.xpm"
#include "xpm/filesave.xpm"
Expand All @@ -96,16 +64,6 @@
#include "xpm/back.xpm"
#include "xpm/forward.xpm"

// #include "xpm/mute.xpm"
//#include "xpm/solobutton_on.xpm"
//#include "xpm/solobutton_off.xpm"
//#include "xpm/solobutton_on_blksq.xpm"
//#include "xpm/solobutton_off_blksq.xpm"
//#include "xpm/mutebutton_on.xpm"
//#include "xpm/mutebutton_off.xpm"
//#include "xpm/rec_echo_on.xpm"
//#include "xpm/rec_echo_off.xpm"

#include "xpm/up.xpm"
#include "xpm/down.xpm"
#include "xpm/bold.xpm"
Expand All @@ -123,8 +81,6 @@
#include "xpm/flagS.xpm"
#include "xpm/lock.xpm"
#include "xpm/toc.xpm"
// #include "xpm/piano.xpm" // not used -Orcan
// #include "xpm/pianoS.xpm"
#include "xpm/exitS.xpm"

#include "xpm/undo.xpm"
Expand All @@ -134,36 +90,22 @@
#include "xpm/editcutS.xpm"
#include "xpm/editcopyS.xpm"
#include "xpm/editpasteS.xpm"
//#include "xpm/editmute.xpm"
#include "xpm/editmuteS.xpm"
#include "xpm/editpastecloneS.xpm"
#include "xpm/editpaste2trackS.xpm"
#include "xpm/editpasteclone2trackS.xpm"

/* Not used - Orcan
#include "xpm/editcut.xpm"
#include "xpm/editcopy.xpm"
#include "xpm/editpaste.xpm"
#include "xpm/editpasteclone.xpm"
#include "xpm/editpaste2track.xpm"
#include "xpm/editpasteclone2track.xpm"
*/
//#include "xpm/speaker.xpm"
#include "xpm/buttondown.xpm"
#include "xpm/configure.xpm"
//#include "xpm/panic.xpm"


// next two lines will vanish soon
#include "xpm/solobutton.xpm"
#include "xpm/newmutebutton.xpm"
//#include "xpm/exit.xpm"
//#include "xpm/exit1.xpm"

#include "xpm/redled.xpm"
#include "xpm/darkredled.xpm"
#include "xpm/greendot.xpm"
//#include "xpm/darkgreendot.xpm"
#include "xpm/bluedot.xpm"
#include "xpm/graydot.xpm"
#include "xpm/off.xpm"
Expand All @@ -174,7 +116,6 @@
#include "xpm/localoffS.xpm"
#include "xpm/miditransformS.xpm"
#include "xpm/midi_plugS.xpm"
//#include "xpm/miditransposeS.xpm"
#include "xpm/mixerS.xpm"
#include "xpm/mustangS.xpm"
#include "xpm/resetS.xpm"
Expand All @@ -183,7 +124,6 @@
#include "xpm/listS.xpm"
#include "xpm/inputpluginS.xpm"
#include "xpm/cliplistS.xpm"
//#include "xpm/mixeraudioS.xpm"
#include "xpm/initS.xpm"

#include "xpm/addtrack_addmiditrack.xpm"
Expand All @@ -209,16 +149,10 @@
#include "xpm/select.xpm"
#include "xpm/select_all.xpm"
#include "xpm/select_all_parts_on_track.xpm"
//#include "xpm/select_deselect_all.xpm"
#include "xpm/select_inside_loop.xpm"
//#include "xpm/select_invert_selection.xpm"
#include "xpm/select_outside_loop.xpm"

//#include "xpm/mono.xpm"
//#include "xpm/stereo.xpm"
#include "xpm/oom_icon.xpm"
//#include "xpm/about_oom.xpm"
//#include "xpm/oom_leftside_logo.xpm"

#include "xpm/global.xpm"
#include "xpm/project.xpm"
Expand Down Expand Up @@ -310,7 +244,7 @@ QPixmap* noteIcon;
QPixmap* stickIcon;
QPixmap* waveIcon;
QPixmap* synthIcon;
QPixmap* markIcon[3];
QPixmap* markIcon[4];
QPixmap* cutIcon;
QPixmap* steprecIcon;
QPixmap* glueIcon;
Expand Down Expand Up @@ -917,11 +851,10 @@ void initIcons()
markIcon[0] = new MPIXMAP(":/images/icons/cmark.png", NULL);
markIcon[1] = new MPIXMAP(":/images/icons/lmark.png", NULL);
markIcon[2] = new MPIXMAP(":/images/icons/rmark.png", NULL);
markIcon[3] = new MPIXMAP(":/images/icons/emark.png", NULL);
cutIcon = new MPIXMAP(":/images/icons/split.png", NULL);
//steprecIcon = new MPIXMAP(steprec_xpm, NULL);
steprecIcon = new MPIXMAP(":/images/icons/step_by_step.png", NULL);
glueIcon = new MPIXMAP(":/images/icons/join_tracks.png", NULL);
//drawIcon = new MPIXMAP(draw_xpm, NULL);
drawIcon = new MPIXMAP(":/images/icons/line-tool.png", NULL);
quantIcon = new MPIXMAP(quant_xpm, NULL);
saveIcon = new MPIXMAP(filesave_xpm, NULL);
Expand Down Expand Up @@ -997,15 +930,6 @@ void initIcons()
editpaste2TrackIconSet = new MICON(editpaste2trackS_xpm, NULL);
editpasteCloneIconSet = new MICON(editpastecloneS_xpm, NULL);
editpasteClone2TrackIconSet = new MICON(editpasteclone2trackS_xpm, NULL); // ..
/* Not used - Orcan
pianoIcon = new MICON(piano_xpm, NULL);
editcutIcon = new MICON(editcut_xpm, "edit-cut");
editcopyIcon = new MICON(editcopy_xpm, "edit-copy");
editpasteIcon = new MICON(editpaste_xpm, "edit-paste");
editpasteCloneIcon = new MICON(editpasteclone_xpm, NULL);
editpaste2TrackIcon = new MICON(editpaste2track_xpm, NULL);
editpasteClone2TrackIcon = new MICON(editpasteclone2track_xpm, NULL);
*/
exitIcon = new MPIXMAP(":/images/icons/mixer-exit.png", NULL);//"application-exit");
exit1Icon = new MPIXMAP(":/images/icons/mixer-exit_on.png", NULL);//"application-exit");

Expand Down Expand Up @@ -1063,17 +987,7 @@ void initIcons()
midiInIconSet3->addPixmap(*midiInIconOn, QIcon::Normal, QIcon::On);
midiInIconSet3->addPixmap(*midiInIconOff, QIcon::Normal, QIcon::Off);
midiInIconSet3->addPixmap(*midiInIconOver, QIcon::Active);
/*
muteIconOn = new MPIXMAP(":/images/icons/mixer-mute_on.png", NULL);
muteIconOff= new MPIXMAP(":/images/icons/mixer-mute.png", NULL);
muteIconOver= new MPIXMAP(":/images/icons/mixer-mute_over.png", NULL);
*/
muteIconSet4 = new QIcon();
/*
muteIconSet4->addPixmap(*muteIconOn, QIcon::Normal, QIcon::On);
muteIconSet4->addPixmap(*muteIconOff, QIcon::Normal, QIcon::Off);
muteIconSet4->addPixmap(*muteIconOver, QIcon::Active);
*/
transport_recordIconOn = new MPIXMAP(":/images/icons/transport-record_new_on.png", NULL);
transport_recordIconOff = new MPIXMAP(":/images/icons/transport-record_new_off.png", NULL);
transport_recordIconOver = new MPIXMAP(":/images/icons/transport-record_new_over.png", NULL);
Expand Down Expand Up @@ -1557,7 +1471,6 @@ void initIcons()
redLedIcon = new MPIXMAP(redled_xpm, NULL);
darkRedLedIcon = new MPIXMAP(darkredled_xpm, NULL);
greendotIcon = new MPIXMAP(greendot_xpm, NULL);
//darkgreendotIcon = new MPIXMAP(darkgreendot_xpm, NULL);
bluedotIcon = new MPIXMAP(bluedot_xpm, NULL);
graydotIcon = new MPIXMAP(graydot_xpm, NULL);
offIcon = new MPIXMAP(off_xpm, NULL);
Expand Down
2 changes: 1 addition & 1 deletion oom/icons.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern QPixmap* note1Icon;
extern QPixmap* stickIcon;
extern QPixmap* waveIcon;
extern QPixmap* synthIcon;
extern QPixmap* markIcon[3];
extern QPixmap* markIcon[4];

extern QPixmap* multiDisplay;
extern QPixmap* previousPartIcon;
Expand Down
1 change: 1 addition & 0 deletions oom/oom.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@
<file>images/icons/cmark.png</file>
<file>images/icons/lmark.png</file>
<file>images/icons/rmark.png</file>
<file>images/icons/emark.png</file>
<file>images/up_arrow_new_on.png</file>
<file>images/up_arrow_new_over.png</file>
<file>images/up_arrow_new_off.png</file>
Expand Down
2 changes: 1 addition & 1 deletion oom/widgets/TempoCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TempoCanvas : public View
DRAG_DELETE, DRAG_COPY_START, DRAG_COPY,
DRAG_RESIZE, DRAG_LASSO_START, DRAG_LASSO
};
unsigned pos[3];
unsigned pos[4];
QPoint start;
QPoint lastPos;
Tool tool;
Expand Down
2 changes: 1 addition & 1 deletion oom/widgets/canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Canvas : public View
QPoint _start;
QPoint _end;
Tool _tool;
unsigned _pos[3];
unsigned _pos[4];

HScrollDir _hscrollDir;
VScrollDir _vscrollDir;
Expand Down
65 changes: 50 additions & 15 deletions oom/widgets/sigscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ SigScale::SigScale(int* r, QWidget* parent, int xs)
{
setToolTip(tr("Signature scale"));
raster = r;
m_startCursorMove = false;
m_movingCursor = false;
pos[0] = song->cpos();
pos[1] = song->lpos();
pos[2] = song->rpos();
pos[3] = MAXINT;
button = Qt::NoButton;
setMouseTracking(true);
connect(song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool)));
Expand Down Expand Up @@ -69,21 +72,43 @@ void SigScale::setPos(int idx, unsigned val, bool)
//redraw(QRect(x, 0, w, height()));
}

void SigScale::viewMousePressEvent(QMouseEvent* event)
void SigScale::viewMousePressEvent(QMouseEvent* event)/*{{{*/
{
button = event->button();
viewMouseMoveEvent(event);
}

void SigScale::viewMouseReleaseEvent(QMouseEvent*)
{
button = Qt::NoButton;
}
//viewMouseMoveEvent(event);
int x = AL::sigmap.raster(event->x(), *raster);
emit timeChanged(x);
pos[3] = x;
int i;
switch (button)
{
case Qt::LeftButton:
i = 0;
pos[0] = x;
break;
case Qt::MidButton:
i = 1;
pos[1] = x;
break;
case Qt::RightButton:
i = 2;
pos[2] = x;
break;
default:
pos[3] = x;
redraw();
return;
}
Pos p(x, true);
song->setPos(i, p);
redraw();
}/*}}}*/

void SigScale::viewMouseMoveEvent(QMouseEvent* event)
{
int x = AL::sigmap.raster(event->x(), *raster);
int x = AL::sigmap.raster(event->x(), *raster);/*{{{*/
emit timeChanged(x);
pos[3] = x;
int i;
switch (button)
{
Expand All @@ -106,9 +131,16 @@ void SigScale::viewMouseMoveEvent(QMouseEvent* event)
}
Pos p(x, true);
song->setPos(i, p);
redraw();
redraw();/*}}}*/
}

void SigScale::viewMouseReleaseEvent(QMouseEvent*)/*{{{*/
{
button = Qt::NoButton;
m_startCursorMove = false;
m_movingCursor = false;
}/*}}}*/

//---------------------------------------------------------
// leaveEvent
//---------------------------------------------------------
Expand Down Expand Up @@ -153,17 +185,20 @@ void SigScale::pdraw(QPainter& p, const QRect& r)
//---------------------------------------------------

//Christopher here is your color
p.setPen(QColor(156,75,219));

QList<QColor> colors;
colors << QColor(0, 186, 255) << QColor(139, 225, 69) << QColor(139, 225, 69) << QColor(156,75,219);
if (pos[3] != MAXINT)
{
p.setPen(colors.at(3));
int xp = mapx(pos[3]);
if (xp >= x && xp < x + w)
p.drawLine(xp, 0, xp, height());
{
p.drawLine(xp, 0, xp, height()-10);
QPixmap* pm = markIcon[3];
p.drawPixmap(xp - pm->width() / 2, 1, *pm);
}
}

QList<QColor> colors;
colors << QColor(0, 186, 255) << QColor(139, 225, 69) << QColor(139, 225, 69);
//colors << QColor(139, 225, 69) << QColor(139, 225, 69) << QColor(0, 186, 255);
for (int i = 0; i < 3; ++i)
{
Expand Down
4 changes: 3 additions & 1 deletion oom/widgets/sigscale.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ class SigScale : public View
{
Q_OBJECT
int* raster;
unsigned pos[3];
unsigned pos[4];
int button;
bool m_startCursorMove;
bool m_movingCursor;

signals:
void posChanged(unsigned, unsigned);
Expand Down
Loading

0 comments on commit 7b3576f

Please sign in to comment.