MCPcopy Create free account
hub / github.com/LMMS/lmms / mouseDoubleClickEvent

Method mouseDoubleClickEvent

src/tracks/SampleTrack.cpp:458–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456
457
458void SampleTCOView::mouseDoubleClickEvent( QMouseEvent * )
459{
460 QString af = m_tco->m_sampleBuffer->openAudioFile();
461
462 if ( af.isEmpty() ) {} //Don't do anything if no file is loaded
463 else if ( af == m_tco->m_sampleBuffer->audioFile() )
464 { //Instead of reloading the existing file, just reset the size
465 int length = (int) ( m_tco->m_sampleBuffer->frames() / Engine::framesPerTick() );
466 m_tco->changeLength(length);
467 }
468 else
469 { //Otherwise load the new file as ususal
470 m_tco->setSampleFile( af );
471 Engine::getSong()->setModified();
472 }
473}
474
475
476

Callers

nothing calls this directly

Calls 8

framesPerTickFunction · 0.85
getSongFunction · 0.85
framesMethod · 0.80
setSampleFileMethod · 0.80
setModifiedMethod · 0.80
openAudioFileMethod · 0.45
isEmptyMethod · 0.45
changeLengthMethod · 0.45

Tested by

no test coverage detected