Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::structure::tracks::TrackRouting Class Reference

Management of track-to-track connections. More...

#include <src/structure/tracks/track_routing.h>

Inheritance diagram for zrythm::structure::tracks::TrackRouting:
Collaboration diagram for zrythm::structure::tracks::TrackRouting:

Public Member Functions

 TrackRouting (TrackRegistry &track_registry, QObject *parent=nullptr)
Q_INVOKABLE QVariant getOutputTrack (const Track *source) const
Q_INVOKABLE void setOutputTrack (const Track *source, const Track *destination)
Q_INVOKABLE bool canRouteTo (const Track *source, const Track *destination) const
 Checks if source can be routed to destination.
Q_SIGNAL void routingChanged ()
 Emitted when a change was made in the routing.
void add_or_replace_route (const TrackUuid &source, const TrackUuid &destination)
void remove_route_for_source (const TrackUuid &source)
void remove_routes_for_destination (const TrackUuid &destination)
std::optional< TrackUuidReference > get_output_track (const TrackUuid &source) const

Friends

void to_json (nlohmann::json &j, const TrackRouting &t)
void from_json (const nlohmann::json &j, TrackRouting &t)

Detailed Description

Management of track-to-track connections.

Definition at line 13 of file track_routing.h.

Member Function Documentation

◆ canRouteTo()

Q_INVOKABLE bool zrythm::structure::tracks::TrackRouting::canRouteTo ( const Track * source,
const Track * destination ) const

Checks if source can be routed to destination.

Routing is allowed when:

  • Source is not null
  • Source is not the master track (master routes internally to device output)
  • Source and destination are not the same track
  • Destination is a valid group target (AudioGroup, MidiGroup, Instrument, or Master)
  • Signal types are compatible (source output type matches destination input type)
  • No circular route would be created (destination is not in source's output chain)
Parameters
sourceThe source track.
destinationThe destination track (null means "unroute").
Returns
true if routing is allowed, false otherwise.

The documentation for this class was generated from the following file: