def take(self): """ Take currently edited. :type: Take """ return reapy.Take(RPR.MIDIEditor_GetTake(self.id))
def parent(self): """ FX parent. :type: Track or Take """ if self.parent_id.startswith("(MediaTrack*)"): return reapy.Track(self.parent_id) return reapy.Take(self.parent_id)
def active_take(self): """ Return the active take of the item. Returns ------- take : Take Active take of the item. """ take = reapy.Take(RPR.GetActiveTake(self.id)) return take
def add_take(self): """ Create and return a new take in item. Returns ------- take : Take New take in item. """ take_id = RPR.AddTakeToMediaItem(self.id) take = reapy.Take(take_id) return take
def takes(self): """ Return list of all takes of media item. Returns ------- takes : list of Take List of all takes of media item. """ n_takes = RPR.GetMediaItemNumTakes(self.id) take_ids = [RPR.GetMediaItemTake(self.id, i) for i in range(n_takes)] takes = [reapy.Take(take_id) for take_id in take_ids] return takes
def takes(self): """ Return list of all takes of media item. Returns ------- takes : list of Take List of all takes of media item. """ code = """ n_takes = RPR.GetMediaItemNumTakes(item_id) take_ids = [RPR.GetMediaItemTake(item_id, i) for i in range(n_takes)] """ take_ids = Program(code, "take_ids").run(item_id=self.id)[0] takes = [reapy.Take(take_id) for take_id in take_ids] return takes
def get_take(self, index): """ Return index-th take of item. Parameters ---------- index : int Take index. Returns ------- take : Take index-th take of media item. """ take_id = RPR.GetItemTake(self.id, index) take = reapy.Take(take_id) return take