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

Method SampleTCO

src/tracks/SampleTrack.cpp:52–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50#include "TrackLabelButton.h"
51
52SampleTCO::SampleTCO( Track * _track ) :
53 TrackContentObject( _track ),
54 m_sampleBuffer( new SampleBuffer ),
55 m_isPlaying( false )
56{
57 saveJournallingState( false );
58 setSampleFile( "" );
59 restoreJournallingState();
60
61 // we need to receive bpm-change-events, because then we have to
62 // change length of this TCO
63 connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ),
64 this, SLOT( updateLength() ), Qt::DirectConnection );
65 connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int,int ) ),
66 this, SLOT( updateLength() ) );
67
68 //care about positionmarker
69 TimeLineWidget * timeLine = Engine::getSong()->getPlayPos( Engine::getSong()->Mode_PlaySong ).m_timeLine;
70 if( timeLine )
71 {
72 connect( timeLine, SIGNAL( positionMarkerMoved() ), this, SLOT( playbackPositionChanged() ) );
73 }
74 //playbutton clicked or space key / on Export Song set isPlaying to false
75 connect( Engine::getSong(), SIGNAL( playbackStateChanged() ),
76 this, SLOT( playbackPositionChanged() ), Qt::DirectConnection );
77 //care about loops
78 connect( Engine::getSong(), SIGNAL( updateSampleTracks() ),
79 this, SLOT( playbackPositionChanged() ), Qt::DirectConnection );
80 //care about mute TCOs
81 connect( this, SIGNAL( dataChanged() ), this, SLOT( playbackPositionChanged() ) );
82 //care about mute track
83 connect( getTrack()->getMutedModel(), SIGNAL( dataChanged() ),
84 this, SLOT( playbackPositionChanged() ), Qt::DirectConnection );
85 //care about TCO position
86 connect( this, SIGNAL( positionChanged() ), this, SLOT( updateTrackTcos() ) );
87
88 switch( getTrack()->trackContainer()->type() )
89 {
90 case TrackContainer::BBContainer:
91 setAutoResize( true );
92 break;
93
94 case TrackContainer::SongContainer:
95 // move down
96 default:
97 setAutoResize( false );
98 break;
99 }
100 updateTrackTcos();
101}
102
103
104

Callers

nothing calls this directly

Calls 5

saveJournallingStateFunction · 0.85
restoreJournallingStateFunction · 0.85
getSongFunction · 0.85
getMutedModelMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected