diff --git a/ChangeLog b/ChangeLog index 79f113a90..61dec1151 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,11 @@ 2008-12-14 Tobias Doerffel + * include/piano_roll.h: * src/gui/piano_roll.cpp: - improved colors for drawing notes - coding style fixes + - added Andrew as copyright holder + - cleanups 2008-12-14 Andrew Kelley diff --git a/include/piano_roll.h b/include/piano_roll.h index 5c30405f0..6907cbd49 100644 --- a/include/piano_roll.h +++ b/include/piano_roll.h @@ -3,6 +3,7 @@ * can set and edit notes in an easy way * * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2008 Andrew Kelley * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -57,17 +58,17 @@ public: inline bool isRecording( void ) const { - return( m_recording ); + return m_recording; } inline const pattern * currentPattern( void ) const { - return( m_pattern ); + return m_pattern; } inline bool validPattern( void ) const { - return( m_pattern != NULL ); + return m_pattern != NULL; } int quantization( void ) const; @@ -78,7 +79,7 @@ public: inline virtual QString nodeName( void ) const { - return( "pianoroll" ); + return "pianoroll"; } @@ -93,9 +94,6 @@ protected: virtual void paintEvent( QPaintEvent * _pe ); virtual void resizeEvent( QResizeEvent * _re ); virtual void wheelEvent( QWheelEvent * _we ); -#ifdef LMMS_BUILD_LINUX - virtual bool x11Event( XEvent * _xe ); -#endif int getKey( int _y ) const; static inline void drawNoteRect( QPainter & _p, int _x, int _y, diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index ac09a59ae..ea1726cd8 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -1,10 +1,9 @@ -#ifndef SINGLE_SOURCE_COMPILE - /* * piano_roll.cpp - implementation of piano-roll which is used for actual * writing of melodies * * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2008 Andrew Kelley * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -2881,7 +2880,7 @@ int pianoRoll::getKey( int _y ) const key_num = KeysPerOctave * NumOctaves - 1; } - return( key_num ); + return key_num; } @@ -3351,11 +3350,11 @@ int pianoRoll::quantization( void ) const { if( m_quantizeModel.value() == 0 ) { - return( newNoteLen() ); + return newNoteLen(); } - return( DefaultTicksPerTact / m_quantizeModel.currentText().right( + return DefaultTicksPerTact / m_quantizeModel.currentText().right( m_quantizeModel.currentText().length() - - 2 ).toInt() ); + 2 ).toInt(); } @@ -3365,11 +3364,11 @@ midiTime pianoRoll::newNoteLen( void ) const { if( m_noteLenModel.value() == 0 ) { - return( m_lenOfNewNotes ); + return m_lenOfNewNotes; } - return( midiTime::ticksPerTact() / m_noteLenModel.currentText().right( + return midiTime::ticksPerTact() / m_noteLenModel.currentText().right( m_noteLenModel.currentText().length() - - 2 ).toInt() ); + 2 ).toInt(); } @@ -3377,8 +3376,8 @@ midiTime pianoRoll::newNoteLen( void ) const bool pianoRoll::mouseOverNote( void ) { - return( validPattern() - && noteIteratorUnderMouse() != m_pattern->notes().end() ); + return validPattern() && + noteIteratorUnderMouse() != m_pattern->notes().end(); } @@ -3386,7 +3385,7 @@ bool pianoRoll::mouseOverNote( void ) note * pianoRoll::noteUnderMouse( void ) { - return( *noteIteratorUnderMouse() ); + return *noteIteratorUnderMouse(); } @@ -3403,7 +3402,7 @@ noteVector::const_iterator pianoRoll::noteIteratorUnderMouse( void ) || pos.y() < PR_TOP_MARGIN || pos.y() > keyAreaBottom() ) { - return( notes.end() ); + return notes.end(); } int key_num = getKey( pos.y() ); @@ -3427,26 +3426,11 @@ noteVector::const_iterator pianoRoll::noteIteratorUnderMouse( void ) ++it; } - return( it ); + return it; } -#ifdef LMMS_BUILD_LINUX -bool pianoRoll::x11Event( XEvent * _xe ) -{ - if( validPattern() ) - { -/* return( m_pattern->getInstrumentTrack()->getPianoWidget() - ->x11Event( _xe ) );*/ - } - return( false ); -} -#endif - - - #include "moc_piano_roll.cxx" -#endif