Skip to content

Commit

Permalink
Get song.view.get('detail_clip') working (#118)
Browse files Browse the repository at this point in the history
get detail_clip working
  • Loading branch information
TheActualWalko authored May 18, 2024
1 parent a810c7c commit 53ea9e1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
7 changes: 7 additions & 0 deletions midi-script/SongView.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .DeviceParameter import DeviceParameter
from .Scene import Scene
from .Track import Track
from .Clip import Clip
from .ClipSlot import ClipSlot


Expand All @@ -13,6 +14,12 @@ def __init__(self, c_instance, socket):
def get_ns(self, nsid):
return self.ableton.song().view

def get_detail_clip(self, ns):
return Clip.serialize_clip(ns.detail_clip)

def set_detail_clip(self, ns, clip_id):
ns.detail_clip = Interface.get_obj(clip_id)

def select_device(self, ns, device_id):
return ns.select_device(Interface.get_obj(device_id))

Expand Down
24 changes: 14 additions & 10 deletions src/ns/song-view.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Ableton } from "..";
import { Namespace } from ".";
import { Device } from "./device";
import { Track, RawTrack } from "./track";
import { Scene, RawScene } from "./scene";
import { RawDeviceParameter, DeviceParameter } from "./device-parameter";
import { Ableton } from "..";
import { Clip, RawClip } from "./clip";
import { ClipSlot, RawClipSlot } from "./clip-slot";
import { Device } from "./device";
import { DeviceParameter, RawDeviceParameter } from "./device-parameter";
import { RawScene, Scene } from "./scene";
import { RawTrack, Track } from "./track";

export interface GettableProperties {
detail_clip: any /* Todo: Implement Clip class */;
detail_clip: RawClip;
draw_mode: boolean;
follow_song: boolean;
highlighted_clip_slot: RawClipSlot;
Expand All @@ -18,23 +19,24 @@ export interface GettableProperties {
}

export interface TransformedProperties {
detail_clip: Clip;
selected_parameter: DeviceParameter;
selected_scene: Scene;
selected_track: Track;
highlighted_clip_slot: ClipSlot;
}

export interface SettableProperties {
detail_clip: any;
detail_clip: RawClip["id"];
draw_mode: boolean;
follow_song: boolean;
highlighted_clip_slot: number;
selected_scene: RawScene['id'];
selected_track: RawTrack['id'];
selected_scene: RawScene["id"];
selected_track: RawTrack["id"];
}

export interface ObservableProperties {
detail_clip: any;
detail_clip: RawClip | null;
draw_mode: any;
follow_song: any;
highlighted_clip_slot: any;
Expand All @@ -58,9 +60,11 @@ export class SongView extends Namespace<
selected_track: (track) => new Track(ableton, track),
selected_scene: (scene) => new Scene(ableton, scene),
highlighted_clip_slot: (slot) => new ClipSlot(ableton, slot),
detail_clip: (clip) => new Clip(ableton, clip),
};

this.cachedProps = {
detail_clip: true,
selected_parameter: true,
selected_track: true,
selected_scene: true,
Expand Down

0 comments on commit 53ea9e1

Please sign in to comment.