jam-cloud/ruby/lib/jam_ruby/lib/subscription_message.rb

30 lines
1.2 KiB
Ruby

module JamRuby
class SubscriptionMessage
# sent whenever we change the desired direction of the source
def self.mount_source_direction(mount)
Notification.send_subscription_message('mount', mount.id, {type: 'source_direction_change', source_direction: true}.to_json)
end
# sent whenever we receive an update about a sourcing attempt by a client
# source_change_json is created by a rabl, so currently only possible to use via web
def self.mount_source_change(mount, source_change_json)
Notification.send_subscription_message('mount', mount.id, source_change_json)
end
def self.mount_source_up_requested(mount)
Notification.send_subscription_message('mount', mount.id, {change_type: IcecastSourceChange::CHANGE_TYPE_MOUNT_UP_REQUEST}.to_json )
end
def self.mount_source_down_requested(mount)
Notification.send_subscription_message('mount', mount.id, {change_type: IcecastSourceChange::CHANGE_TYPE_MOUNT_DOWN_REQUEST}.to_json )
end
def self.jam_track_signing_job_change(jam_track_right)
Notification.send_subscription_message('jam_track_right', jam_track_right.id.to_s, {signing_state: jam_track_right.signing_state}.to_json )
end
end
end