Changeset 884
- Timestamp:
- 03/11/09 00:12:25 (4 years ago)
- Location:
- branches/transport_redesign/libs/hydrogen
- Files:
-
- 3 modified
-
include/hydrogen/TransportPosition.h (modified) (1 diff)
-
src/transport/JackTransportMaster.cpp (modified) (4 diffs)
-
src/transport/SimpleTransportMaster.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/transport_redesign/libs/hydrogen/include/hydrogen/TransportPosition.h
r883 r884 36 36 { 37 37 enum { STOPPED, ROLLING } state; /// The current transport state. 38 bool new_position; /// True if this position is not a continuation 39 /// of the last one (i.e. we've relocated) 38 40 uint32_t frame; /// The current frame of the transport. When 39 41 /// sequencing, this is just FYI. All -
branches/transport_redesign/libs/hydrogen/src/transport/JackTransportMaster.cpp
r866 r884 38 38 public: 39 39 jack_client_t* client; 40 uint32_t next_frame; 40 41 }; 41 42 … … 43 44 { 44 45 d = new JackTransportMasterPrivate; 46 d.client = 0; 47 d.next_frame = (uint32_t)-1; 45 48 } 46 49 … … 85 88 hpos->state = TransportPosition::STOPPED; 86 89 } 90 hpos->new_position = ( jpos.frame != d->next_frame ) 87 91 hpos->frame = jpos.frame; 88 92 hpos->frame_rate = jpos.frame_rate; … … 99 103 } 100 104 101 void JackTransportMaster::processed_frames(uint32_t /*nFrames*/)105 void JackTransportMaster::processed_frames(uint32_t nFrames) 102 106 { 103 // Handled by JACK server. 107 jack_transport_state_t state; 108 jack_position_t jpos; 109 110 state = jack_transport_query(d->client, &jpos); 111 if( state == TransportPosition::ROLLING ) { 112 d->next_frame = jpos.frame + nFrames; 113 } else { 114 d->next_frame = jpos.frame; 115 } 104 116 } 105 117 -
branches/transport_redesign/libs/hydrogen/src/transport/SimpleTransportMaster.cpp
r866 r884 76 76 d->pos.tick = (abs_tick - d->pos.bar_start_tick) % d->pos.ticks_per_beat; 77 77 d->pos.frame = frame; 78 d->pos.new_position = true; 78 79 return 0; 79 80 } … … 115 116 / d->pos.beats_per_minute; 116 117 118 d->pos.new_position = true; 117 119 118 120 return 0; … … 156 158 157 159 d->pos.frame += nFrames; 160 d->pos.new_position = false; 158 161 159 162 d->pos.bbt_offset += nFrames;