unified track-view appearence and behaviour

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1303 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2008-07-12 12:47:34 +00:00
parent 3d0a8e95a2
commit c08cc778fd
31 changed files with 242 additions and 300 deletions

View File

@@ -1501,9 +1501,8 @@ void trackOperationsWidget::removeTrack( void )
/*! \brief Update the trackOperationsWidget context menu
*
* If we're in the Beat+Bassline Editor, we can supply the enable or
* disable automation options. For all track types, we have the Clone
* and Remove options as well.
* For all track types, we have the Clone and Remove options.
* For instrument-tracks we also offer the MIDI-control-menu
*/
void trackOperationsWidget::updateMenu( void )
{
@@ -1515,6 +1514,13 @@ void trackOperationsWidget::updateMenu( void )
to_menu->addAction( embed::getIconPixmap( "cancel", 16, 16 ),
tr( "Remove this track" ),
this, SLOT( removeTrack() ) );
if( dynamic_cast<instrumentTrackView *>( m_trackView ) )
{
to_menu->addSeparator();
to_menu->addMenu( dynamic_cast<instrumentTrackView *>(
m_trackView )->midiMenu() );
}
}

View File

@@ -65,6 +65,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) :
setModel( new boolModel( FALSE, NULL, _caption, TRUE ) );
setAutoFillBackground( TRUE );
unsetCursor();
}

View File

@@ -1,7 +1,7 @@
#ifndef SINGLE_SOURCE_COMPILE
/*
* name_label.cpp - implementation of class nameLabel, a label which
* name_label.cpp - implementation of class trackLabelButton, a label which
* is renamable by double-clicking it
*
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
@@ -29,6 +29,7 @@
#include <QtGui/QFileDialog>
#include <QtGui/QMouseEvent>
#include <QtGui/QPainter>
#include <QtGui/QToolButton>
#include "name_label.h"
@@ -39,35 +40,46 @@
#include "gui_templates.h"
#include "config_mgr.h"
#include "engine.h"
#include <QtGui/QHBoxLayout>
nameLabel::nameLabel( const QString & _initial_name, QWidget * _parent ) :
QLabel( _initial_name, _parent ),
trackLabelButton::trackLabelButton( trackView * _tv, QWidget * _parent ) :
QToolButton( _parent ),
m_trackView( _tv ),
m_pixmap(),
m_pixmapFile( "" )
{
setAcceptDrops( TRUE );
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
setToolButtonStyle( Qt::ToolButtonTextBesideIcon );
setFixedSize( 160, 29 );
updateName();
connect( m_trackView->getTrack(), SIGNAL( dataChanged() ),
this, SLOT( updateName() ) );
}
nameLabel::~nameLabel()
trackLabelButton::~trackLabelButton()
{
}
void nameLabel::setPixmap( const QPixmap & _pixmap )
void trackLabelButton::setPixmap( const QPixmap & _pixmap )
{
m_pixmap = _pixmap;
setIcon( m_pixmap );
}
void nameLabel::setPixmapFile( const QString & _file )
void trackLabelButton::setPixmapFile( const QString & _file )
{
QPixmap new_pixmap;
if( QFileInfo( _file ).isRelative() )
@@ -83,7 +95,7 @@ void nameLabel::setPixmapFile( const QString & _file )
{
return;
}
m_pixmap = new_pixmap;
setPixmap( new_pixmap );
m_pixmapFile = _file;
emit( pixmapChanged() );
update();
@@ -92,7 +104,7 @@ void nameLabel::setPixmapFile( const QString & _file )
void nameLabel::selectPixmap( void )
void trackLabelButton::selectPixmap( void )
{
QFileDialog ofd( NULL, tr( "Select icon" ) );
@@ -141,24 +153,31 @@ void nameLabel::selectPixmap( void )
void nameLabel::rename( void )
void trackLabelButton::rename( void )
{
QString txt = text();
QString txt = m_trackView->getTrack()->name();
renameDialog rename_dlg( txt );
rename_dlg.exec();
if( txt != text() )
{
setText( txt );
emit nameChanged( txt );
m_trackView->getTrack()->setName( txt );
updateName();
}
}
void nameLabel::mousePressEvent( QMouseEvent * _me )
void trackLabelButton::updateName( void )
{
setText( m_trackView->getTrack()->name() );
}
void trackLabelButton::mousePressEvent( QMouseEvent * _me )
{
if( _me->button() == Qt::RightButton )
{
QSize s( m_pixmap.width(), m_pixmap.height() );
@@ -174,14 +193,14 @@ void nameLabel::mousePressEvent( QMouseEvent * _me )
}
else
{
emit clicked();
QToolButton::mousePressEvent( _me );
}
}
void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me )
void trackLabelButton::mouseDoubleClickEvent( QMouseEvent * _me )
{
QSize s( m_pixmap.width(), m_pixmap.height() );
s.scale( width(), height(), Qt::KeepAspectRatio );
@@ -198,45 +217,22 @@ void nameLabel::mouseDoubleClickEvent( QMouseEvent * _me )
void nameLabel::paintEvent( QPaintEvent * )
void trackLabelButton::dragEnterEvent( QDragEnterEvent * _dee )
{
QPainter p( this );
p.fillRect( rect(),
parentWidget()->palette().color( backgroundRole() ) );
int x = 4;
if( m_pixmap.isNull() == FALSE )
{
QPixmap pm = m_pixmap;
if( pm.height() > height() )
{
pm = pm.scaledToHeight( height(),
Qt::SmoothTransformation );
}
p.drawPixmap( x, ( height() - pm.height() ) / 2, pm );
x += 4 + pm.width();
}
p.setPen( QColor( 160, 160, 160 ) );
bbTrack * bbt = bbTrack::findBBTrack(
engine::getBBTrackContainer()->currentBB() );
trackSettingsWidget * w = dynamic_cast<trackSettingsWidget *>( parentWidget() );
if( bbt != NULL && w != NULL )
{
bbTrackView * bbtv = dynamic_cast<bbTrackView *>( w->parentWidget() );
if( bbtv != NULL && bbtv->getBBTrack() == bbt )
{
p.setPen( QColor( 255, 255, 255 ) );
}
}
p.drawText( x, height() / 2 + p.fontMetrics().height() / 2 - 4,
text() );
m_trackView->dragEnterEvent( _dee );
}
void trackLabelButton::dropEvent( QDropEvent * _de )
{
m_trackView->dropEvent( _de );
setChecked( TRUE );
}
#include "name_label.moc"

View File

@@ -116,13 +116,11 @@ automationTrackView::automationTrackView( automationTrack * _at,
trackView( _at, _tcv )
{
setFixedHeight( 32 );
m_trackLabel = new nameLabel( _at->name(), getTrackSettingsWidget() );
m_trackLabel->setPixmap( embed::getIconPixmap( "automation" ) );
m_trackLabel->setGeometry( 1, 1, DEFAULT_SETTINGS_WIDGET_WIDTH - 2,
29 );
m_trackLabel->show();
connect( m_trackLabel, SIGNAL( nameChanged( const QString & ) ),
_at, SLOT( setName( const QString & ) ) );
trackLabelButton * tlb = new trackLabelButton( this,
getTrackSettingsWidget() );
tlb->setPixmap( embed::getIconPixmap( "automation_track" ) );
tlb->move( 3, 1 );
tlb->show();
setModel( _at );
}

View File

@@ -238,12 +238,7 @@ void bbTCOView::openInBBEditor( void )
void bbTCOView::resetName( void )
{
if( dynamic_cast<bbTrackView *>( getTrackView() ) != NULL )
{
m_bbTCO->setName(
dynamic_cast<bbTrackView *>( getTrackView() )->
trackLabel()->text() );
}
m_bbTCO->setName( m_bbTCO->getTrack()->name() );
}
@@ -529,22 +524,16 @@ bbTrackView::bbTrackView( bbTrack * _bbt, trackContainerView * _tcv ) :
// too), so disable it
setAcceptDrops( FALSE );
m_trackLabel = new nameLabel( _bbt->name(),
getTrackSettingsWidget() );
m_trackLabel = new trackLabelButton( this, getTrackSettingsWidget() );
m_trackLabel->setPixmap( embed::getIconPixmap( "bb_track" ) );
m_trackLabel->setGeometry( 1, 1, DEFAULT_SETTINGS_WIDGET_WIDTH - 2,
29 );
m_trackLabel->move( 3, 1 );
m_trackLabel->show();
connect( m_trackLabel, SIGNAL( clicked() ),
connect( m_trackLabel, SIGNAL( clicked( bool ) ),
this, SLOT( clickedTrackLabel() ) );
connect( m_trackLabel, SIGNAL( nameChanged( const QString & ) ),
_bbt, SLOT( setName( const QString & ) ) );
connect( m_trackLabel, SIGNAL( nameChanged( const QString & ) ),
connect( m_trackLabel, SIGNAL( nameChanged() ),
engine::getBBTrackContainer(), SLOT( updateComboBox() ) );
connect( m_trackLabel, SIGNAL( pixmapChanged() ),
engine::getBBTrackContainer(), SLOT( updateComboBox() ) );
connect( _bbt, SIGNAL( dataChanged() ),
m_trackLabel, SLOT( update() ) );
setModel( _bbt );
}
@@ -573,11 +562,11 @@ void bbTrackView::clickedTrackLabel( void )
engine::getBBTrackContainer()->setCurrentBB(
bbTrack::numOfBBTrack( m_bbTrack ) );
engine::getBBEditor()->show();
foreach( bbTrackView * tv,
/* foreach( bbTrackView * tv,
getTrackContainerView()->findChildren<bbTrackView *>() )
{
tv->m_trackLabel->update();
}
}*/
}

View File

@@ -54,6 +54,7 @@
#include "effect_rack_view.h"
#include "embed.h"
#include "engine.h"
#include "fx_mixer.h"
#include "fx_mixer_view.h"
#include "instrument_sound_shaping.h"
#include "instrument_sound_shaping_view.h"
@@ -66,7 +67,7 @@
#include "main_window.h"
#include "midi_client.h"
#include "midi_port_menu.h"
#include "fx_mixer.h"
#include "name_label.h"
#include "mmp.h"
#include "note_play_handle.h"
#include "pattern.h"
@@ -84,15 +85,6 @@ const char * volume_help = QT_TRANSLATE_NOOP( "instrumentTrack",
"With this knob you can set "
"the volume of the opened "
"channel.");
const char * surroundarea_help = QT_TRANSLATE_NOOP( "instrumentTrack",
"Within this rectangle you can "
"set the position where the "
"channel should be audible. "
"You should have a soundcard "
"supporting at least surround "
"4.0 for enjoying this "
"feature." );
const int INSTRUMENT_WIDTH = 254;
const int INSTRUMENT_HEIGHT = INSTRUMENT_WIDTH;
@@ -772,34 +764,39 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
setAcceptDrops( TRUE );
setFixedHeight( 32 );
m_tlb = new trackLabelButton( this, getTrackSettingsWidget() );
m_tlb->setCheckable( TRUE );
m_tlb->setPixmap( embed::getIconPixmap( "instrument_track" ) );
m_tlb->move( 3, 1 );
m_tlb->show();
connect( m_tlb, SIGNAL( toggled( bool ) ),
this, SLOT( toggleInstrumentWindow( bool ) ) );
connect( _it, SIGNAL( nameChanged() ),
m_tlb, SLOT( updateName() ) );
// creation of widgets for track-settings-widget
m_tswVolumeKnob = new knob( knobSmall_17, getTrackSettingsWidget(),
m_volumeKnob = new knob( knobSmall_17, getTrackSettingsWidget(),
tr( "Volume" ) );
m_tswVolumeKnob->setVolumeKnob( TRUE );
m_tswVolumeKnob->setModel( &_it->m_volumeModel );
m_tswVolumeKnob->setHintText( tr( "Volume:" ) + " ", "%" );
m_tswVolumeKnob->move( 4, 4 );
m_tswVolumeKnob->setLabel( tr( "VOL" ) );
m_tswVolumeKnob->show();
m_tswVolumeKnob->setWhatsThis( tr( volume_help ) );
m_volumeKnob->setVolumeKnob( TRUE );
m_volumeKnob->setModel( &_it->m_volumeModel );
m_volumeKnob->setHintText( tr( "Volume:" ) + " ", "%" );
m_volumeKnob->move( DEFAULT_SETTINGS_WIDGET_WIDTH-24*2, 4 );
m_volumeKnob->setLabel( tr( "VOL" ) );
m_volumeKnob->show();
m_volumeKnob->setWhatsThis( tr( volume_help ) );
m_tswPanningKnob = new knob( knobSmall_17, getTrackSettingsWidget(),
m_panningKnob = new knob( knobSmall_17, getTrackSettingsWidget(),
tr( "Panning" ) );
m_tswPanningKnob->setModel( &_it->m_panningModel );
m_tswPanningKnob->setHintText( tr( "Panning:" ) + " ", "%" );
m_tswPanningKnob->move( 24, 4 );
m_tswPanningKnob->setLabel( tr( "PAN" ) );
m_tswPanningKnob->show();
m_panningKnob->setModel( &_it->m_panningModel );
m_panningKnob->setHintText( tr( "Panning:" ) + " ", "%" );
m_panningKnob->move( DEFAULT_SETTINGS_WIDGET_WIDTH-24, 4 );
m_panningKnob->setLabel( tr( "PAN" ) );
m_panningKnob->show();
QPushButton * tsw_midi = new QPushButton(
embed::getIconPixmap( "piano" ), QString::null,
getTrackSettingsWidget() );
tsw_midi->setGeometry( 50, 2, 28, 28 );
tsw_midi->show();
toolTip::add( tsw_midi, tr( "MIDI input/output" ) );
m_tswMidiMenu = new QMenu( tsw_midi );
tsw_midi->setMenu( m_tswMidiMenu );
m_midiMenu = new QMenu( tr( "MIDI" ), this );
// sequenced MIDI?
if( !engine::getMixer()->getMIDIClient()->isRaw() )
@@ -812,15 +809,15 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
&_it->m_midiPort );
_it->m_midiPort.m_writablePortsMenu->setModel(
&_it->m_midiPort );
m_midiInputAction = m_tswMidiMenu->addMenu(
m_midiInputAction = m_midiMenu->addMenu(
_it->m_midiPort.m_readablePortsMenu );
m_midiOutputAction = m_tswMidiMenu->addMenu(
m_midiOutputAction = m_midiMenu->addMenu(
_it->m_midiPort.m_writablePortsMenu );
}
else
{
m_midiInputAction = m_tswMidiMenu->addAction( "" );
m_midiOutputAction = m_tswMidiMenu->addAction( "" );
m_midiInputAction = m_midiMenu->addAction( "" );
m_midiOutputAction = m_midiMenu->addAction( "" );
m_midiInputAction->setCheckable( TRUE );
m_midiOutputAction->setCheckable( TRUE );
connect( m_midiInputAction, SIGNAL( changed() ), this,
@@ -831,34 +828,24 @@ instrumentTrackView::instrumentTrackView( instrumentTrack * _it,
this, SLOT( midiConfigChanged() ) );
}
m_midiInputAction->setText( tr( "MIDI input" ) );
m_midiOutputAction->setText( tr( "MIDI output" ) );
m_midiInputAction->setText( tr( "Input" ) );
m_midiOutputAction->setText( tr( "Output" ) );
m_tswActivityIndicator = new fadeButton( QColor( 56, 60, 72 ),
m_activityIndicator = new fadeButton( QColor( 56, 60, 72 ),
QColor( 64, 255, 16 ),
getTrackSettingsWidget() );
m_tswActivityIndicator->setGeometry( 212, 2, 8, 28 );
m_tswActivityIndicator->show();
connect( m_tswActivityIndicator, SIGNAL( pressed( void ) ),
m_activityIndicator->setGeometry(
DEFAULT_SETTINGS_WIDGET_WIDTH-2*24-11, 2, 8, 28 );
m_activityIndicator->show();
connect( m_activityIndicator, SIGNAL( pressed( void ) ),
this, SLOT( activityIndicatorPressed() ) );
connect( m_tswActivityIndicator, SIGNAL( released( void ) ),
connect( m_activityIndicator, SIGNAL( released( void ) ),
this, SLOT( activityIndicatorReleased() ) );
connect( _it, SIGNAL( newNote() ),
m_tswActivityIndicator, SLOT( activate() ) );
m_activityIndicator, SLOT( activate() ) );
m_tswInstrumentTrackButton = new instrumentTrackButton( this );
m_tswInstrumentTrackButton->setCheckable( TRUE );
m_tswInstrumentTrackButton->setGeometry( 82, 2, 126, 28 );
m_tswInstrumentTrackButton->show();
setModel( _it );
connect( m_tswInstrumentTrackButton, SIGNAL( toggled( bool ) ),
this, SLOT( toggledInstrumentTrackButton( bool ) ) );
connect( _it, SIGNAL( nameChanged() ),
m_tswInstrumentTrackButton, SLOT( update() ) );
}
@@ -938,9 +925,27 @@ instrumentTrackWindow * instrumentTrackView::getInstrumentTrackWindow( void )
void instrumentTrackView::toggledInstrumentTrackButton( bool _on )
void instrumentTrackView::dragEnterEvent( QDragEnterEvent * _dee )
{
getInstrumentTrackWindow()->toggledInstrumentTrackButton( _on );
getInstrumentTrackWindow()->dragEnterEvent( _dee );
trackView::dragEnterEvent( _dee );
}
void instrumentTrackView::dropEvent( QDropEvent * _de )
{
getInstrumentTrackWindow()->dropEvent( _de );
trackView::dropEvent( _de );
}
void instrumentTrackView::toggleInstrumentWindow( bool _on )
{
getInstrumentTrackWindow()->toggleVisibility( _on );
if( !_on )
{
@@ -1069,7 +1074,6 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
m_volumeKnob->width() + 16, 44 );
m_panningKnob->setHintText( tr( "Panning:" ) + " ", "" );
m_panningKnob->setLabel( tr( "PAN" ) );
//// m_surroundArea->setWhatsThis( tr( surroundarea_help ) );
m_pitchKnob = new knob( knobBright_26, m_generalSettingsWidget,
@@ -1133,30 +1137,20 @@ instrumentTrackWindow::instrumentTrackWindow( instrumentTrackView * _itv ) :
setModel( _itv->model() );
// set window-icon
setWindowIcon( embed::getIconPixmap( "instrument_track" ) );
updateInstrumentView();
setFixedWidth( INSTRUMENT_WIDTH );
resize( sizeHint() );
if( engine::getMainWindow()->workspace() )
{
QMdiSubWindow * subWin =
QMdiSubWindow * subWin =
engine::getMainWindow()->workspace()->addSubWindow( this );
Qt::WindowFlags flags = subWin->windowFlags();
flags |= Qt::MSWindowsFixedSizeDialogHint;
flags &= ~Qt::WindowMaximizeButtonHint;
subWin->setWindowFlags( flags );
subWin->setFixedSize( subWin->size() );
parentWidget()->hide();
}
else
{
hide();
}
Qt::WindowFlags flags = subWin->windowFlags();
flags |= Qt::MSWindowsFixedSizeDialogHint;
flags &= ~Qt::WindowMaximizeButtonHint;
subWin->setWindowFlags( flags );
subWin->setWindowIcon( embed::getIconPixmap( "instrument_track" ) );
subWin->setFixedSize( subWin->size() );
subWin->hide();
}
@@ -1267,8 +1261,6 @@ void instrumentTrackWindow::updateInstrumentView( void )
m_tabWidget->addTab( m_instrumentView, tr( "PLUGIN" ), 0 );
m_tabWidget->setActiveTab( 0 );
}
// m_tswInstrumentTrackButton->update();
}
@@ -1283,33 +1275,18 @@ void instrumentTrackWindow::textChanged( const QString & _new_name )
void instrumentTrackWindow::toggledInstrumentTrackButton( bool _on )
void instrumentTrackWindow::toggleVisibility( bool _on )
{
if( _on )
{
if( engine::getMainWindow()->workspace() )
{
show();
parentWidget()->show();
parentWidget()->raise();
}
else
{
show();
raise();
}
show();
parentWidget()->show();
parentWidget()->raise();
}
else
{
if( engine::getMainWindow()->workspace() )
{
parentWidget()->hide();
}
else
{
hide();
}
parentWidget()->hide();
}
}
@@ -1327,7 +1304,7 @@ void instrumentTrackWindow::closeEvent( QCloseEvent * _ce )
{
hide();
}
m_itv->m_tswInstrumentTrackButton->setChecked( FALSE );
m_itv->m_tlb->setChecked( FALSE );
}
@@ -1388,7 +1365,7 @@ void instrumentTrackWindow::loadSettings( const QDomElement & _this )
mainWindow::restoreWidgetState( this, _this );
if( isVisible() )
{
m_itv->m_tswInstrumentTrackButton->setChecked( TRUE );
m_itv->m_tlb->setChecked( TRUE );
}
}
@@ -1397,28 +1374,7 @@ void instrumentTrackWindow::loadSettings( const QDomElement & _this )
instrumentTrackButton::instrumentTrackButton( instrumentTrackView * _itv ) :
QPushButton( _itv->getTrackSettingsWidget() ),
m_instrumentTrackView( _itv )
{
setAcceptDrops( TRUE );
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
}
instrumentTrackButton::~instrumentTrackButton()
{
}
void instrumentTrackButton::paintEvent( QPaintEvent * _pe )
/*void instrumentTrackButton::paintEvent( QPaintEvent * _pe )
{
QPushButton::paintEvent( _pe );
QPainter p( this );
@@ -1434,28 +1390,11 @@ void instrumentTrackButton::paintEvent( QPaintEvent * _pe )
p.drawText( ( width() - QFontMetrics( p.font() ).width( n ) ) /
2 + extra, height() / 2 - 2 +
QFontMetrics( p.font() ).height() + extra, n );
}
}*/
void instrumentTrackButton::dragEnterEvent( QDragEnterEvent * _dee )
{
m_instrumentTrackView->getInstrumentTrackWindow()->
dragEnterEvent( _dee );
}
void instrumentTrackButton::dropEvent( QDropEvent * _de )
{
m_instrumentTrackView->getInstrumentTrackWindow()->dropEvent( _de );
setChecked( TRUE );
}
#include "instrument_track.moc"

View File

@@ -28,10 +28,12 @@
#include <Qt/QtXml>
#include <QtGui/QDropEvent>
#include <QtGui/QLayout>
#include <QtGui/QMdiArea>
#include <QtGui/QPainter>
#include <QtGui/QPushButton>
#include "effect_label.h"
#include "name_label.h"
#include "sample_track.h"
#include "song.h"
#include "embed.h"
@@ -43,6 +45,8 @@
#include "sample_play_handle.h"
#include "string_pair_drag.h"
#include "knob.h"
#include "main_window.h"
#include "effect_rack_view.h"
@@ -378,7 +382,7 @@ void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc,
{
m_audioPort.getEffects()->saveState( _doc, _this );
#if 0
_this.setAttribute( "icon", m_trackLabel->pixmapFile() );
_this.setAttribute( "icon", tlb->pixmapFile() );
#endif
m_volumeModel.saveSettings( _doc, _this, "vol" );
}
@@ -406,7 +410,7 @@ void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this )
#if 0
if( _this.attribute( "icon" ) != "" )
{
m_trackLabel->setPixmapFile( _this.attribute( "icon" ) );
tlb->setPixmapFile( _this.attribute( "icon" ) );
}
#endif
m_volumeModel.loadSettings( _this, "vol" );
@@ -422,23 +426,32 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv )
{
setFixedHeight( 32 );
m_trackLabel = new effectLabel( getTrackSettingsWidget(), _t );
#if 0
m_trackLabel = new nameLabel( tr( "Sample track" ),
trackLabelButton * tlb = new trackLabelButton( this,
getTrackSettingsWidget() );
m_trackLabel->setPixmap( embed::getIconPixmap( "sample_track" ) );
#endif
m_trackLabel->setGeometry( 26, 1, DEFAULT_SETTINGS_WIDGET_WIDTH-2, 29 );
m_trackLabel->show();
connect( tlb, SIGNAL( clicked( bool ) ),
this, SLOT( showEffects() ) );
tlb->setPixmap( embed::getIconPixmap( "sample_track" ) );
tlb->move( 3, 1 );
tlb->show();
m_volumeKnob = new knob( knobSmall_17, getTrackSettingsWidget(),
tr( "Track volume" ) );
m_volumeKnob->setVolumeKnob( TRUE );
m_volumeKnob->setModel( &_t->m_volumeModel );
m_volumeKnob->setHintText( tr( "Channel volume:" ) + " ", "%" );
m_volumeKnob->move( 4, 4 );
m_volumeKnob->move( DEFAULT_SETTINGS_WIDGET_WIDTH-2*24, 4 );
m_volumeKnob->setLabel( tr( "VOL" ) );
m_volumeKnob->show();
m_effectRack = new effectRackView( _t->getAudioPort()->getEffects() );
m_effectRack->setFixedSize( 240, 242 );
engine::getMainWindow()->workspace()->addSubWindow( m_effectRack );
m_effWindow = m_effectRack->parentWidget();
m_effWindow->setAttribute( Qt::WA_DeleteOnClose, FALSE );
m_effWindow->layout()->setSizeConstraint( QLayout::SetFixedSize );
m_effWindow->setWindowTitle( _t->name() );
m_effWindow->hide();
}
@@ -446,6 +459,23 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv )
sampleTrackView::~sampleTrackView()
{
m_effWindow->deleteLater();
}
void sampleTrackView::showEffects( void )
{
if( m_effWindow->isHidden() )
{
m_effWindow->show();
m_effWindow->raise();
}
else
{
m_effWindow->hide();
}
}