What line to edit to use Middle Click for Starting Loop?

Having trouble with LMMS? Ask about it here.
LMSS-1.3Alpha

I just can't work without this feature.

I'm building LMSS from Source Code. Please tell me what line to edit to bring back the old Starting-Ending Loop feature.

All this zooming to hold and move loop points is driving me crazy!
This might help you: https://github.com/LMMS/lmms/commit/cdc ... 9ef59abf1f
Check out src/core/track.cpp. You just want to manually undo the changes shown, re-adding deleted lines and deleting added lines.
I think I might have to copy/paste this entire section:

Code: Select all



/*! \brief Handle a mouse press on this trackContentObjectView.
 *
 *  Handles the various ways in which a trackContentObjectView can be
 *  used with a click of a mouse button.
 *
 *  * If our container supports rubber band selection then handle
 *    selection events.
 *  * or if shift-left button, add this object to the selection
 *  * or if ctrl-left button, start a drag-copy event
 *  * or if just plain left button, resize if we're resizeable
 *  * or if ctrl-middle button, mute the track content object
 *  * or if middle button, maybe delete the track content object.
 *
 * \param me The QMouseEvent to handle.
 */
void TrackContentObjectView::mousePressEvent( QMouseEvent * me )
{
	setInitialMousePos( me->pos() );
	if( m_trackView->trackContainerView()->allowRubberband() == true &&
	    me->button() == Qt::LeftButton )
	{
		if( m_trackView->trackContainerView()->rubberBandActive() == true )
		{
			// Propagate to trackView for rubberbanding
			selectableObject::mousePressEvent( me );
		}
		else if ( me->modifiers() & Qt::ControlModifier )
		{
			if( isSelected() == true )
			{
				m_action = CopySelection;
			}
			else
			{
				m_action = ToggleSelected;
			}
		}
		else if( !me->modifiers() )
		{
			if( isSelected() == true )
			{
				m_action = MoveSelection;
			}
		}
	}
	else if( me->button() == Qt::LeftButton &&
			 me->modifiers() & Qt::ControlModifier )
	{
		// start drag-action
		QVector<TrackContentObjectView *> tcoViews;
		tcoViews.push_back( this );
		DataFile dataFile = createTCODataFiles( tcoViews );
		QPixmap thumbnail = QPixmap::grabWidget( this ).scaled(
						128, 128,
						Qt::KeepAspectRatio,
						Qt::SmoothTransformation );
		new StringPairDrag( QString( "tco_%1" ).arg(
						m_tco->getTrack()->type() ),
					dataFile.toString(), thumbnail, this );
	}
	else if( me->button() == Qt::LeftButton &&
		/* (me->modifiers() & Qt::ShiftModifier) &&*/
							fixedTCOs() == false )
	{
		m_tco->addJournalCheckPoint();

		// move or resize
		m_tco->setJournalling( false );

		setInitialMousePos( me->pos() );

		if( m_tco->getAutoResize() || me->x() < width() - RESIZE_GRIP_WIDTH )
		{
			m_action = Move;
			setCursor( Qt::SizeAllCursor );
			delete m_hint;
			m_hint = TextFloat::displayMessage( tr( "Hint" ),
					tr( "Press <%1> and drag to make "
							"a copy." ).arg(
								#ifdef LMMS_BUILD_APPLE
								"⌘"),
								#else
								"Ctrl"),
								#endif
					embed::getIconPixmap( "hint" ), 0 );
			s_textFloat->setTitle( tr( "Current position" ) );
			s_textFloat->setText( QString( "%1:%2" ).
					arg( m_tco->startPosition().getTact() + 1 ).
					arg( m_tco->startPosition().getTicks() %
							MidiTime::ticksPerTact() ) );
			s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2 ) );
		}
		else
		{
			m_action = Resize;
			setCursor( Qt::SizeHorCursor );
			delete m_hint;
			m_hint = TextFloat::displayMessage( tr( "Hint" ),
					tr( "Press <%1> for free "
							"resizing." ).arg(
								#ifdef LMMS_BUILD_APPLE
								"⌘"),
								#else
								"Ctrl"),
								#endif
					embed::getIconPixmap( "hint" ), 0 );
			s_textFloat->setTitle( tr( "Current length" ) );
			s_textFloat->setText( tr( "%1:%2 (%3:%4 to %5:%6)" ).
					arg( m_tco->length().getTact() ).
					arg( m_tco->length().getTicks() %
							MidiTime::ticksPerTact() ).
					arg( m_tco->startPosition().getTact() + 1 ).
					arg( m_tco->startPosition().getTicks() %
							MidiTime::ticksPerTact() ).
					arg( m_tco->endPosition().getTact() + 1 ).
					arg( m_tco->endPosition().getTicks() %
							MidiTime::ticksPerTact() ) );
			s_textFloat->moveGlobal( this, QPoint( width() + 2, height() + 2) );
		}
//		s_textFloat->reparent( this );
		s_textFloat->show();
	}
	else if( me->button() == Qt::RightButton )
	{
		if( me->modifiers() & Qt::ControlModifier )
		{
			m_tco->toggleMute();
		}
		else if( me->modifiers() & Qt::ShiftModifier && fixedTCOs() == false )
		{
			remove();
		}
	}
	else if( me->button() == Qt::MidButton )
	{
		if( me->modifiers() & Qt::ControlModifier )
		{
			m_tco->toggleMute();
		}
		else if( fixedTCOs() == false )
		{
			remove();
		}
	}
}
Xeno Idaltu wrote:
Thu Apr 07, 2022 8:27 am
I think I might have to copy/paste this entire section:
(Made your text to code -use the </> button for code tags).
Unfortunately you cant use 'old' code directly in 1.3.
There has been changes to the codebase since right / middle mouse controlled looppoints:
Everything using 'pattern' is renamed 'clip' -There are issues with that..
hasValidPattern has been renamed to hasValidMidiClip
m_pattern has been renamed to m_midiClip

Imo lft loop-point should always be right-mouse, rgt loop-point should always be sh+right-mouse.
So why isent it
Because it messed up, when someone used lft-posistion as right, and vis-a-vi..🙄
But its Bull...
I will much prefer
lft loop-point should always be right-mouse, rgt loop-point should always be sh+right-mouse, and avoid that dragging around with endpoints; Because that is what you should do: DRAG the loop-point!
There are no need for magnifying and what-nuts, just hold your mouse next to the looppoint you want to change, press mouse, move mouse. Then 1.3 looppoints works!
I still think Middle Click is more efficient as we don't have to look at our keyboard to make sure we are pressing the correct key. Its also better than holding the Right Click to set loop points. I just dont like using the keyboard for things that were already the most efficient. I'm a KDE user not a Gnome user.
I'm creating complex Goa Trance loops and projects that are 6min long and this is irritating me so much because I got so used to the easy flow of 1.2. I also can't downgrade as the features found on 1.3-Alpha are not found in 1.2

Either way, I prefer your approach than what we currently have. Can you send me the code I need to add to the file.
Agreed with OP, I prefer middle click. The main reason it was changed, was because middle click isn't available to laptop users and is an unusual button.
N/A
Using https://github.com/LMMS/lmms/commit/cdc ... 9ef59abf1f as reference, try modifying (instead of replacing) https://github.com/LMMS/lmms/blob/maste ... /Track.cpp and https://github.com/LMMS/lmms/blob/maste ... eTrack.cpp by deleting and adding lines? I'm sorry I can't help more. I don't know C++. But you should be mostly safe, if you are careful.
However, I wish you all the best. I would also like to request that, if you are using Windows, you send a link to the resultant binary so we can download it if we want it.
Xeno Idaltu wrote:
Sat Apr 16, 2022 8:02 am
N/A
But cant you see the inconvenience, as Monospace said:
middle click isn't available to laptop users

That mean that everytime an update of lmms is made, you need to rebuild your own version, with middle-click, if you want the new versions new features?
Setting Loop-points will be changed to a better/ intuitive way. I dont like the current way either, especially if there is a long loop and the start needs to be moved then ..its a ..drag.. (PI : )
The argument for not using Middle-click is weak, because LMMS still uses it for togle mute of clips 🙄
So why is it not a breeze to change one mouse usage to another?
The answer is qT
The qT gadget that needs to be used for multiple-mouseoptions, are not used in LMMS!
I had the exact same problem when i tried to implement a two-function feature, i wanted one for left, and the opposite for right-mouse -Easy-peasy
Ehrr... NOT!
The qT code for that is... Overwhelming, and i have NO idea why it need to be.. (Actually i do: Cross-platform is the culprit :/ )
The whole method needs to be re-written, and a different qT-class needs to be instantiated in that new code, witch most likely will conflict with all other time-line features, and therefore break them.
Its dead hard to do!