Add new comment

Hi Marko,

Awesome! It should work for the purpose at hand with flying colors :) I'll have the chance to take your code and commit to CVS as soon you give your blessing :)

	// Handle volume controls...                                                                                                                                         
	if (pCtlEvent->controller() == 7) {                                                                                                                         
		int iTrack = 0;
		for (qtractorTrack *pTrack = m_pSession->tracks().first();
				pTrack; pTrack = pTrack->next()) {
			if (pTrack->trackType() == qtractorTrack::Midi &&
				pTrack->midiChannel() == pCtlEvent->channel()) {
				float fGain = float(pCtlEvent->value()) / 127.0f;
				// Set track gain/volume directly,
				// bypassing the undo/redo system
				// to avoid feedback issues with
				// motorized external controllers...
				pTrack->setGain(fGain);
				qtractorMidiBus *pMidiBus
					= static_cast (pTrack->outputBus());
				if (pMidiBus)                                              
					pMidiBus->setVolume(pTrack, fGain);
				qtractorMixer *pMixer = mixer();
				if (pMixer) {
					qtractorMixerStrip *pStrip
						= pMixer->trackRack()->findStrip(pTrack->monitor());
					if (pStrip && pStrip->meter())
						pStrip->meter()->updateGain();
				}
				sCtlText += tr("(track %1, gain %2)")
					.arg(iTrack).arg(fGain);
			}
			++iTrack;
		}
	}

	// Handle pan controls...
	if (pCtlEvent->controller() == 10) {
		int iTrack = 0;
		for (qtractorTrack *pTrack = m_pSession->tracks().first();
				pTrack; pTrack = pTrack->next()) {
			if (pTrack->trackType() == qtractorTrack::Midi &&
				pTrack->midiChannel() == pCtlEvent->channel()) {
				// Set track panning directly,
				// bypassing the undo/redo system
				// to avoid feedback issues with
				// motorized external controllers...
				float fPanning = (float(pCtlEvent->value()) - 63.0f) / 64.0f;
				pTrack->setPanning(fPanning);
				qtractorMidiBus *pMidiBus
					= static_cast (pTrack->outputBus());
				if (pMidiBus)
					pMidiBus->setPanning(pTrack, fPanning);
				qtractorMixer *pMixer = mixer();
				if (pMixer) {
					qtractorMixerStrip *pStrip
						= pMixer->trackRack()->findStrip(pTrack->monitor());
					if (pStrip && pStrip->meter())
						pStrip->meter()->updatePanning();
				}
				sCtlText += tr("(track %1, panning %2)")
					.arg(iTrack).arg(fPanning);
			}
			iTrack++;
		}
	}
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.