lot of bugfixes, UI-improvements and more

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@56 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2006-01-23 09:25:49 +00:00
parent 7e6538d9b3
commit b762ad706f
101 changed files with 1789 additions and 536 deletions

View File

@@ -47,10 +47,10 @@
#include "types.h"
class QComboBox;
class QPixmap;
class channelTrack;
class comboBox;
class groupBox;
class knob;
class ledCheckBox;
@@ -124,12 +124,12 @@ private:
// chord-stuff
groupBox * m_chordsGroupBox;
QComboBox * m_chordsComboBox;
comboBox * m_chordsComboBox;
knob * m_chordRangeKnob;
// arpeggio-stuff
groupBox * m_arpGroupBox;
QComboBox * m_arpComboBox;
comboBox * m_arpComboBox;
knob * m_arpRangeKnob;
tempoSyncKnob * m_arpTimeKnob;
knob * m_arpGateKnob;
@@ -140,7 +140,7 @@ private:
pixmapButton * m_arpUpAndDownBtn;
pixmapButton * m_arpRandomBtn;
QComboBox * m_arpModeComboBox;
comboBox * m_arpModeComboBox;
} ;

View File

@@ -1,7 +1,7 @@
/*
* bb_editor.h - declaration of class bbEditor, a basic-component of LMMS
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -33,10 +33,12 @@
#include "lmms_main_win.h"
class toolButton;
class songEditor;
class QPixmap;
class comboBox;
class songEditor;
class toolButton;
class bbEditor : public trackContainer
{
@@ -71,7 +73,6 @@ public:
}
csize currentBB( void ) const;
void FASTCALL setCurrentBB( csize _bb );
tact FASTCALL lengthOfBB( csize _bb );
inline tact lengthOfCurrentBB( void )
{
@@ -85,11 +86,18 @@ public:
void updateBBTrack( trackContentObject * _tco );
public slots:
void updateComboBox( void );
void setCurrentBB( int _bb );
protected:
virtual void closeEvent( QCloseEvent * _ce );
virtual void keyPressEvent( QKeyEvent * _ke );
virtual void resizeEvent( QResizeEvent * _re );
virtual QRect scrollAreaRect( void ) const;
protected slots:
void play( void );
@@ -111,6 +119,8 @@ private:
toolButton * m_playButton;
toolButton * m_stopButton;
comboBox * m_bbComboBox;
friend class songEditor;
friend lmmsMainWin::~lmmsMainWin();

View File

@@ -2,7 +2,7 @@
* bb_track.h - class bbTrack, a wrapper for using bbEditor
* (which is a singleton-class) as track
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -135,12 +135,8 @@ protected:
private:
nameLabel * m_trackLabel;
struct bbInfoStruct
{
csize num;
QString name;
} ;
static QMap<bbTrack *, bbInfoStruct> s_bbNums;
typedef QMap<bbTrack *, csize> infoMap;
static infoMap s_infoMap;
} ;

117
include/combobox.h Normal file
View File

@@ -0,0 +1,117 @@
/*
* combobox.h - class comboBox, a very cool combo-box
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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; either
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _COMBOBOX_H
#define _COMBOBOX_H
#include "qt3support.h"
#ifdef QT4
#include <QWidget>
#include <QVector>
#include <QMenu>
#include <QPixmap>
#include <QPair>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#include <qpopupmenu.h>
#include <qpixmap.h>
#include <qpair.h>
#endif
class QAction;
class comboBox : public QWidget
{
Q_OBJECT
public:
comboBox( QWidget * _parent );
virtual ~comboBox();
void addItem( const QString & _item, const QPixmap & _pixmap =
QPixmap() );
inline void clear( void )
{
m_currentIndex = 0;
m_items.clear();
update();
}
int findText( const QString & _txt ) const;
int currentIndex( void ) const
{
return( m_currentIndex );
}
QString currentText( void ) const
{
return( m_items[m_currentIndex].first );
}
public slots:
void setCurrentIndex( int _idx );
protected:
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void wheelEvent( QWheelEvent * _we );
private:
static QPixmap * s_background;
static QPixmap * s_arrow;
QMenu m_menu;
typedef QPair<QString, QPixmap> item;
vvector<item> m_items;
int m_currentIndex;
bool m_pressed;
private slots:
void setItem( QAction * _item );
void setItem( int _item );
signals:
void activated( const QString & );
void currentIndexChanged( int );
} ;
#endif

View File

@@ -66,6 +66,7 @@ const QString PROJECTS_PATH = "projects/";
const QString PRESETS_PATH = "presets/";
const QString SAMPLES_PATH = "samples/";
const QString ARTWORK_PATH = "artwork/";
const QString TRACK_ICON_PATH = "artwork/track_icons/";
const QString LOCALE_PATH = "locale/";
@@ -107,6 +108,11 @@ public:
return( m_dataDir + ARTWORK_PATH );
}
QString trackIconsDir( void ) const
{
return( m_dataDir + TRACK_ICON_PATH );
}
QString localeDir( void ) const
{
return( m_dataDir + LOCALE_PATH );

View File

@@ -3,7 +3,7 @@
* provides UI- and DSP-code for using envelopes, LFOs
* and a filter
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -46,14 +46,15 @@
#include "envelope_and_lfo_widget.h"
class QComboBox;
class groupBox;
class tabWidget;
class QLabel;
class knob;
class pixmapButton;
class channelTrack;
class comboBox;
class groupBox;
class knob;
class notePlayHandle;
class pixmapButton;
class tabWidget;
class envelopeTabWidget : public QWidget, public settings
@@ -97,7 +98,7 @@ private:
// filter-stuff
groupBox * m_filterGroupBox;
QComboBox * m_filterComboBox;
comboBox * m_filterComboBox;
knob * m_filterCutKnob;
knob * m_filterResKnob;

View File

@@ -2,7 +2,7 @@
* export_project_dialog.h - declaration of class exportProjectDialog which is
* responsible for exporting project
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -31,7 +31,6 @@
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
@@ -44,15 +43,15 @@
#endif
#include "export.h"
class QLabel;
class QPushButton;
class QComboBox;
class QProgressBar;
class QCheckBox;
class comboBox;
class ledCheckBox;
class pixmapButton;
@@ -88,11 +87,11 @@ private:
QString m_fileName;
QLabel * m_typeLbl;
QComboBox * m_typeCombo;
comboBox * m_typeCombo;
QLabel * m_kbpsLbl;
QComboBox * m_kbpsCombo;
QCheckBox * m_vbrCb;
QCheckBox * m_hqmCb;
comboBox * m_kbpsCombo;
ledCheckBox * m_vbrCb;
ledCheckBox * m_hqmCb;
QLabel * m_hourglassLbl;
QPushButton * m_exportBtn;
QPushButton * m_cancelBtn;

View File

@@ -1,7 +1,7 @@
/*
* lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -58,7 +58,6 @@ public:
return( m_number->intValue() );
}
void setValue( int _value );
void setLabel( const QString & _txt );
inline void addTextForValue( int _val, const QString & _text )
@@ -68,6 +67,7 @@ public:
public slots:
void setValue( int _value );
virtual void setEnabled( bool _on );

View File

@@ -2,7 +2,7 @@
* name_label.h - class nameLabel, a label which is renamable by
* double-clicking it
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -46,20 +46,32 @@ class nameLabel : public QLabel
{
Q_OBJECT
public:
nameLabel( const QString & _initial_name, QWidget * _parent,
const QPixmap & _pm = QPixmap() );
nameLabel( const QString & _initial_name, QWidget * _parent );
~nameLabel();
const QPixmap * pixmap( void ) const;
const QPixmap & pixmap( void ) const
{
return( m_pixmap );
}
const QString & pixmapFile( void ) const
{
return( m_pixmapFile );
}
public slots:
void setPixmap( const QPixmap & _pm );
void setPixmap( const QPixmap & _pixmap );
void setPixmapFile( const QString & _file );
void rename( void );
void selectPixmap( void );
signals:
void nameChanged( const QString & _new_name );
void clicked( void );
void nameChanged( void );
void nameChanged( const QString & _new_name );
void pixmapChanged( void );
protected:
@@ -69,7 +81,8 @@ protected:
private:
QPixmap m_pm;
QPixmap m_pixmap;
QString m_pixmapFile;
} ;

View File

@@ -36,6 +36,7 @@
#include <QMutex>
#include <QDialog>
#include <QThread>
#include <QPixmap>
#else
@@ -44,6 +45,7 @@
#include <qmutex.h>
#include <qdialog.h>
#include <qthread.h>
#include <qpixmap.h>
#endif
@@ -54,7 +56,6 @@
class QAction;
class QPixmap;
class QProgressBar;
class QPushButton;
@@ -84,9 +85,6 @@ public:
void init( void );
virtual void FASTCALL movePosition( const midiTime & _pos );
virtual midiTime length( void ) const;
note * FASTCALL addNote( const note & _new_note );
@@ -159,6 +157,10 @@ public:
}
public slots:
virtual void update( void );
protected slots:
void openInPianoRoll( bool _c );
void openInPianoRoll( void );
@@ -180,21 +182,27 @@ protected:
virtual void constructContextMenu( QMenu * );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void wheelEvent( QWheelEvent * _we );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re )
{
m_needsUpdate = TRUE;
trackContentObject::resizeEvent( _re );
}
virtual void wheelEvent( QWheelEvent * _we );
void ensureBeatNotes( void );
void updateBBTrack( void );
private:
static QPixmap * s_patternBg;
static QPixmap * s_stepBtnOn;
static QPixmap * s_stepBtnOverlay;
static QPixmap * s_stepBtnOff;
static QPixmap * s_stepBtnOffLight;
static QPixmap * s_frozen;
QPixmap m_paintPixmap;
bool m_needsUpdate;
// general stuff
channelTrack * m_channelTrack;

View File

@@ -47,17 +47,16 @@
#include "note.h"
class QComboBox;
class QPainter;
class QPixmap;
class QScrollBar;
class toolButton;
class pattern;
class notePlayHandle;
class timeLine;
class comboBox;
class lmmsMainWin;
class notePlayHandle;
class pattern;
class timeLine;
class toolButton;
class pianoRoll : public QWidget
@@ -205,7 +204,7 @@ private:
toolButton * m_copyButton;
toolButton * m_pasteButton;
QComboBox * m_zoomingComboBox;
comboBox * m_zoomingComboBox;
QPixmap m_paintPixmap;
bool m_cursorInside;

View File

@@ -1,7 +1,7 @@
/*
* pixmap_button.h - declaration of class pixmapButton
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -56,11 +56,17 @@ public:
void FASTCALL setInactiveGraphic( const QPixmap & _pm,
bool _update = TRUE );
void FASTCALL setBgGraphic( const QPixmap & _pm );
#ifndef QT4
#ifdef QT3
inline void setChecked( bool _on )
{
setOn( _on );
}
inline bool isChecked( void ) const
{
return( isOn() );
}
#endif

View File

@@ -69,7 +69,7 @@ inline QString baseName( const QString & _file )
}
#else
#else /* QT3 */
#define vvector QValueVector
@@ -117,6 +117,7 @@ inline QString baseName( const QString & _file )
// QScrollView/QScrollArea
#define setHorizontalScrollBarPolicy setHScrollBarMode
#define setVerticalScrollBarPolicy setVScrollBarMode
// QScrollBar
@@ -189,6 +190,10 @@ inline QString baseName( const QString & _file )
#define setColumnMinimumWidth setColSpacing
// QRect
#define normalized normalize
// Qt-namespace
#define ShiftModifier ShiftButton
#define ControlModifier ControlButton

View File

@@ -27,7 +27,6 @@
#ifndef QT4
#include <qwidget.h>
/*#include <kdelibs_export.h>*/
#ifdef Q_WS_X11

121
include/rubberband.h Normal file
View File

@@ -0,0 +1,121 @@
/*
* rubberband.h - rubberband - either own implementation for Qt3 or wrapper for
* Qt4
*
* Copyright (c) 2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* 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; either
* 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 (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _RUBBERBAND_H
#define _RUBBERBAND_H
#include "qt3support.h"
#ifndef QT3
#include <QRubberBand>
#include <QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
class selectableObject : public QWidget
{
Q_OBJECT
public:
selectableObject( QWidget * _parent
#ifdef QT3
, WFlags _f
#endif
) :
QWidget( _parent, NULL, _f ),
m_selected( FALSE )
{
}
virtual ~selectableObject()
{
}
inline void setSelected( bool _selected )
{
m_selected = _selected;
update();
}
inline bool isSelected( void ) const
{
return( m_selected );
}
public slots:
virtual void update( void )
{
QWidget::update();
}
private:
bool m_selected;
} ;
typedef
#ifndef QT3
QRubberBand
#else
QWidget
#endif
rubberBandBase;
class rubberBand : public rubberBandBase
{
public:
rubberBand( QWidget * _parent );
virtual ~rubberBand();
vvector<selectableObject *> selectedObjects( void ) const;
protected:
virtual void resizeEvent( QResizeEvent * _re );
#ifdef QT3
virtual bool event( QEvent * _e );
void updateMask( void );
#endif
private:
vvector<selectableObject *> selectableObjects( void ) const;
};
#endif

View File

@@ -2,7 +2,7 @@
* song_editor.h - declaration of class songEditor, a window where you can
* setup your songs
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -29,20 +29,20 @@
#include "track_container.h"
#include "types.h"
#include "tool_button.h"
class QComboBox;
class QLabel;
class QScrollBar;
class QSlider;
class comboBox;
class lcdSpinBox;
class lmmsMainWin;
class pattern;
class projectNotes;
class textFloat;
class timeLine;
class toolButton;
const int MIN_BPM = 10;
@@ -51,7 +51,6 @@ const int MAX_BPM = 999;
const Uint16 MAX_SONG_LENGTH = 9999;
class songEditor : public trackContainer
{
Q_OBJECT
@@ -204,11 +203,18 @@ public slots:
protected:
void closeEvent( QCloseEvent * _ce );
void resizeEvent( QResizeEvent * _re );
void keyPressEvent( QKeyEvent * _ke );
void wheelEvent( QWheelEvent * _we );
void paintEvent( QPaintEvent * _pe );
virtual void closeEvent( QCloseEvent * _ce );
virtual void resizeEvent( QResizeEvent * _re );
virtual void keyPressEvent( QKeyEvent * _ke );
virtual void wheelEvent( QWheelEvent * _we );
virtual void paintEvent( QPaintEvent * _pe );
virtual QRect scrollAreaRect( void ) const;
virtual bool allowRubberband( void ) const
{
return( m_editModeButton->isChecked() );
}
protected slots:
@@ -232,6 +238,8 @@ protected slots:
void zoomingChanged( const QString & _zfac );
void doActions( void );
private:
songEditor();
@@ -273,10 +281,11 @@ private:
toolButton * m_addBBTrackButton;
toolButton * m_addSampleTrackButton;
toolButton * m_insertBarButton;
toolButton * m_removeBarButton;
QComboBox * m_zoomingComboBox;
toolButton * m_drawModeButton;
toolButton * m_editModeButton;
comboBox * m_zoomingComboBox;
QString m_fileName;
@@ -310,8 +319,6 @@ private:
} ;
vvector<ACTIONS> m_actions;
void doActions( void );
friend class lmmsMainWin;

View File

@@ -1,7 +1,7 @@
/*
* tab_button.h - declaration of class tabButton
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -52,10 +52,22 @@ public:
connect( this, SIGNAL( clicked() ), this,
SLOT( slotClicked() ) );
}
virtual ~tabButton()
~tabButton()
{
}
#ifdef QT3
inline void setChecked( bool _on )
{
setOn( _on );
}
inline bool isChecked( void ) const
{
return( isOn() );
}
#endif
signals:
void clicked( int );

View File

@@ -69,7 +69,7 @@ public:
timeLine( int _xoff, int _yoff, float _ppt, songEditor::playPos & _pos,
const midiTime & _begin, QWidget * _parent );
~timeLine();
virtual ~timeLine();
inline songEditor::playPos & pos( void )
{
@@ -117,11 +117,14 @@ public:
public slots:
void updatePosition( const midiTime & = 0 );
void updatePosition( const midiTime & );
void updatePosition( void )
{
updatePosition( midiTime() );
}
void toggleAutoScroll( int _n );
void toggleLoopPoints( int _n );
void toggleBehaviourAtStop( int _n );
void checkForUpdatedPosition( void );
protected:

View File

@@ -1,7 +1,7 @@
/*
* tool_button.h - declaration of class toolButton
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -70,11 +70,21 @@ public:
m_colorHighlighted = _color;
}
#ifndef QT4
#ifdef QT3
inline void setIcon( const QPixmap & _icon )
{
setIconSet( _icon );
}
inline void setChecked( bool _on )
{
setOn( _on );
}
inline bool isChecked( void ) const
{
return( isOn() );
}
#endif

View File

@@ -55,6 +55,7 @@
#include "types.h"
#include "midi_time.h"
#include "settings.h"
#include "rubberband.h"
class QMenu;
@@ -76,7 +77,7 @@ const Uint16 TRACK_OP_WIDTH = 70;
const Uint16 TCO_BORDER_WIDTH = 1;
class trackContentObject : public QWidget, public settings
class trackContentObject : public selectableObject, public settings
{
Q_OBJECT
public:
@@ -99,7 +100,9 @@ public:
{
return( m_length );
}
bool fixedTCOs( void );
virtual void FASTCALL movePosition( const midiTime & _pos );
virtual void FASTCALL changeLength( const midiTime & _length );
@@ -132,13 +135,17 @@ protected slots:
private:
enum actions
{
NONE, MOVE, MOVE_SELECTION, RESIZE
} ;
static textFloat * s_textFloat;
track * m_track;
midiTime m_startPosition;
midiTime m_length;
bool m_moving;
bool m_resizing;
actions m_action;
bool m_autoResize;
Sint16 m_initialMouseX;
@@ -167,10 +174,12 @@ public:
{
return( m_pixelsPerTact );
}
inline void setPixelsPerTact( Uint16 _ppt )
{
m_pixelsPerTact = _ppt;
}
tact length( void ) const;
@@ -184,8 +193,7 @@ protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
@@ -296,9 +304,11 @@ public:
bool isMovingTrack( void ) const
{
return( m_movingTrack );
return( m_action == MOVE_TRACK );
}
virtual void repaint( void );
public slots:
void changePosition( const midiTime & _new_pos = -1 );
@@ -317,14 +327,17 @@ protected:
private:
enum actions
{
NONE, MOVE_TRACK, RESIZE_TRACK
} ;
track * m_track;
trackOperationsWidget m_trackOperationsWidget;
trackSettingsWidget m_trackSettingsWidget;
trackContentWidget m_trackContentWidget;
bool m_movingTrack;
Sint16 m_initialMouseX;
actions m_action;
} ;

View File

@@ -2,7 +2,7 @@
* track_container.h - base-class for all track-containers like Song-Editor,
* BB-Editor...
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -46,10 +46,13 @@
#include "track.h"
#include "settings.h"
#include "rubberband.h"
const Uint16 DEFAULT_PIXELS_PER_TACT = 16;
const Uint16 DEFAULT_SCROLLBAR_SIZE = 16;
class trackContainer : public QMainWindow, public settings
{
@@ -102,14 +105,38 @@ public:
const trackWidget * trackWidgetAt( const int _y ) const;
virtual bool allowRubberband( void ) const;
inline bool rubberBandActive( void ) const
{
return( m_rubberBand->isVisible() );
}
inline vvector<selectableObject *> selectedObjects( void )
{
if( allowRubberband() == TRUE )
{
return( m_rubberBand->selectedObjects() );
}
return( vvector<selectableObject *>() );
}
protected:
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void resizeEvent( QResizeEvent * );
constTrackVector tracks( void ) const;
trackVector tracks( void );
virtual QRect scrollAreaRect( void ) const
{
return( rect() );
}
midiTime m_currentPosition;
@@ -141,6 +168,9 @@ private:
trackWidgetVector m_trackWidgets;
float m_ppt;
rubberBand * m_rubberBand;
QPoint m_origin;
friend class scrollArea;