Add new comment

First of all, I know you're on vacation and that it's meant to be enjoyed. It's not urgent at all :).

It's not working as expected... but let's go step by step:

1_
I think I didn't express myself correctly. The word wasn't maximize, but restore.
The idea is for it to work like an on/off button.

2_
Your answer made me realize that you could also add a maximize function that would expand/restore the track height to the maximum height of the workspace. This would be useful when using Qtractor as an audio editor (I know it isn't, but... for many tasks I prefer it to Audacity).

3_
I tried implementing the minimize function... but, as always, C++ is too finicky for me. It doesn't accept setProperty like that, outright, as I'd like. However, the desired logic is as follows:

// Minimize current track height.
void qtractorMainForm::trackHeightMinimize (void)
{
	qtractorTrack *pTrack = nullptr;
	if (m_pTracks)
		pTrack = m_pTracks->currentTrack();
	if (pTrack == nullptr)
		return;

#ifdef CONFIG_DEBUG
	qDebug("qtractorMainForm::trackHeightMinimize()");
#endif

	const int iVerticalZoom = m_pSession->verticalZoom();

///////////////////// Changes

	const int iZoomTrackHeightMin = (iVerticalZoom * qtractorTrack::HeightMin) / 100;
	const int iZoomTrackHeightBase = (iVerticalZoom * qtractorTrack::HeightBase) / 100;	
	const int iZoomTrackHeightCurrent = (iVerticalZoom * pTrack->zoomHeight()) / 100;
	
	
	if (iZoomTrackHeightCurrent > iZoomTrackHeightMin) {
		pTrack->setProperty("RestoreHeightTo", iZoomTrackHeightCurrent);
		const int iZoomHeight = iZoomTrackHeightMin;
	}

	if (iZoomTrackHeightCurrent <= iZoomTrackHeightMin ){
		// To restore default to base, in case there is no previous height record
        	if (!ptrack->property("RestoreHeightTo").isValid()) {
			pTrack->setProperty("RestoreHeightTo", iZoomTrackHeightBase);
		}
		const int iZoomHeight =  pTrack->property("RestoreHeightTo");
	}


	m_pSession->execute(
		new qtractorResizeTrackCommand(pTrack, iZoomHeight));
}
The content of this field is kept private and will not be shown publicly.

Markdown

  • Parses markdown and converts it to HTML.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id> <img src alt height width> <strike> <pre> <p> <br>
  • Lines and paragraphs break automatically.

Filtered HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <b> <i> <pre> <img src alt height width> <strike>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
File attachments
Unlimited number of files can be uploaded to this field.
2 MB limit.
Allowed types: jpg jpeg gif png txt doc docx xls xlsx pdf ppt pps odt ods odp zip gz bz2 xz patch diff wav ogg flac ogv mp4 qtz.