MCPcopy Create free account
hub / github.com/audacity/audacity / SendTracks

Method SendTracks

src/commands/GetInfoCommand.cpp:478–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

476}
477
478bool GetInfoCommand::SendTracks(const CommandContext & context)
479{
480 auto &tracks = TrackList::Get( context.project );
481 context.StartArray();
482 for (auto trk : tracks)
483 {
484 auto &trackFocus = TrackFocus::Get( context.project );
485 Track * fTrack = trackFocus.Get();
486
487 context.StartStruct();
488 context.AddItem( trk->GetName(), "name" );
489 context.AddBool( (trk == fTrack), "focused");
490 context.AddBool( trk->GetSelected(), "selected" );
491 //JKC: Possibly add later...
492 //context.AddItem(ChannelView::GetChannelGroupHeight(*trk), "height");
493 trk->TypeSwitch( [&] (const WaveTrack &t) {
494 float vzmin, vzmax;
495 WaveformScale::Get(t).GetDisplayBounds(vzmin, vzmax);
496 context.AddItem( "wave", "kind" );
497 context.AddItem( t.GetStartTime(), "start" );
498 context.AddItem( t.GetEndTime(), "end" );
499 context.AddItem( t.GetPan() , "pan");
500 context.AddItem( t.GetVolume() , "volume");
501 context.AddItem( t.NChannels(), "channels");
502 context.AddBool( t.GetSolo(), "solo" );
503 context.AddBool( t.GetMute(), "mute");
504 context.AddItem( vzmin, "VZoomMin");
505 context.AddItem( vzmax, "VZoomMax");
506 },
507#if defined(USE_MIDI)
508 [&](const NoteTrack &) {
509 context.AddItem( "note", "kind" );
510 },
511#endif
512 [&](const LabelTrack &) {
513 context.AddItem( "label", "kind" );
514 },
515 [&](const TimeTrack &) {
516 context.AddItem( "time", "kind" );
517 }
518 );
519 context.EndStruct();
520 }
521 context.EndArray();
522 return true;
523}
524
525bool GetInfoCommand::SendClips(const CommandContext &context)
526{

Callers

nothing calls this directly

Calls 15

GetFunction · 0.85
GetPanMethod · 0.80
GetVolumeMethod · 0.80
StartArrayMethod · 0.45
GetMethod · 0.45
StartStructMethod · 0.45
AddItemMethod · 0.45
GetNameMethod · 0.45
AddBoolMethod · 0.45
GetSelectedMethod · 0.45
GetStartTimeMethod · 0.45
GetEndTimeMethod · 0.45

Tested by

no test coverage detected