RPR DeleteProjectMarker
From CockosWiki
(→Python) |
(→Perl) |
||
Line 20: | Line 20: | ||
===Perl=== | ===Perl=== | ||
<pre> | <pre> | ||
+ | # *** not tested | ||
+ | |||
+ | # ------------------------------------------------------------------------ | ||
+ | # DeleteProjectMarker.pl | ||
+ | # | ||
+ | # syntax: | ||
+ | # bool DeleteProjectMarker(void* proj, int markrgnindexnumber, bool isrgn) | ||
+ | # returns array: | ||
+ | # (bool, void* proj, int markrgnindexnumber, bool isrgn) | ||
+ | # ------------------------------------------------------------------------ | ||
+ | |||
+ | use strict; | ||
+ | use warnings; | ||
+ | |||
+ | my $CURR_PROJ = 0; | ||
+ | my $pos; | ||
+ | my $isrgn; | ||
+ | my $rgnend; | ||
+ | my $name; | ||
+ | my $wantidx; | ||
+ | |||
+ | my @result; | ||
+ | my @retval; | ||
+ | |||
+ | # add region | ||
+ | $pos = 1; | ||
+ | $isrgn = 1; # is region | ||
+ | $rgnend = 3; | ||
+ | $name = "first region"; | ||
+ | $wantidx = 1; # id is here | ||
+ | @retval = RPR_AddProjectMarker($CURR_PROJ, $isrgn, $pos, $rgnend, $name, $wantidx); | ||
+ | |||
+ | # delete region | ||
+ | @result = RPR_DeleteProjectMarker($CURR_PROJ, $wantidx, 1); | ||
+ | if (@result[0]) | ||
+ | { | ||
+ | RPR_ShowConsoleMsg("region deleted"); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | RPR_ShowConsoleMsg("region not deleted"); | ||
+ | }; | ||
+ | RPR_ShowConsoleMsg("\n"); | ||
+ | |||
+ | # add marker | ||
+ | $pos = 5; | ||
+ | $isrgn = 0; # not a region | ||
+ | $rgnend = 8; | ||
+ | $name = "a marker"; | ||
+ | $wantidx = 2; # id is here | ||
+ | @retval = RPR_AddProjectMarker($CURR_PROJ, $isrgn, $pos, $rgnend, $name, $wantidx); | ||
+ | |||
+ | # delete marker | ||
+ | @result = RPR_DeleteProjectMarker($CURR_PROJ, $wantidx, 0); | ||
+ | if (@result[0]) | ||
+ | { | ||
+ | RPR_ShowConsoleMsg("region deleted"); | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | RPR_ShowConsoleMsg("region not deleted"); | ||
+ | }; | ||
+ | RPR_ShowConsoleMsg("\n"); | ||
+ | |||
</pre> | </pre> | ||
Revision as of 17:47, 13 December 2009
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR DeleteProjectMarker
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR DeleteProjectMarker
Contents |
DeleteProjectMarker()
bool DeleteProjectMarker(void* proj, int markrgnindexnumber, bool isrgn)
Delete a marker. proj==NULL for the active project.
Parameters
void* proj, int markrgnindexnumber, bool isrgn
Returns
An array, containing bool void* proj, int markrgnindexnumber, bool isrgn
Examples
C++
Perl
# *** not tested # ------------------------------------------------------------------------ # DeleteProjectMarker.pl # # syntax: # bool DeleteProjectMarker(void* proj, int markrgnindexnumber, bool isrgn) # returns array: # (bool, void* proj, int markrgnindexnumber, bool isrgn) # ------------------------------------------------------------------------ use strict; use warnings; my $CURR_PROJ = 0; my $pos; my $isrgn; my $rgnend; my $name; my $wantidx; my @result; my @retval; # add region $pos = 1; $isrgn = 1; # is region $rgnend = 3; $name = "first region"; $wantidx = 1; # id is here @retval = RPR_AddProjectMarker($CURR_PROJ, $isrgn, $pos, $rgnend, $name, $wantidx); # delete region @result = RPR_DeleteProjectMarker($CURR_PROJ, $wantidx, 1); if (@result[0]) { RPR_ShowConsoleMsg("region deleted"); } else { RPR_ShowConsoleMsg("region not deleted"); }; RPR_ShowConsoleMsg("\n"); # add marker $pos = 5; $isrgn = 0; # not a region $rgnend = 8; $name = "a marker"; $wantidx = 2; # id is here @retval = RPR_AddProjectMarker($CURR_PROJ, $isrgn, $pos, $rgnend, $name, $wantidx); # delete marker @result = RPR_DeleteProjectMarker($CURR_PROJ, $wantidx, 0); if (@result[0]) { RPR_ShowConsoleMsg("region deleted"); } else { RPR_ShowConsoleMsg("region not deleted"); }; RPR_ShowConsoleMsg("\n");
Python
# ------------------------------------------------------------------------ # DeleteProjectMarker.py # # syntax: # bool DeleteProjectMarker(void* proj, int markrgnindexnumber, bool isrgn) # returns array: # (bool, void* proj, int markrgnindexnumber, bool isrgn) # ------------------------------------------------------------------------ CURR_PROJ = 0; result = (); # add region pos = 1; isrgn = 1; # is region rgnend = 3; name = "first region"; wantidx = 1; # id is here retval = RPR_AddProjectMarker(CURR_PROJ, isrgn, pos, rgnend, name, wantidx); # delete region result = RPR_DeleteProjectMarker(CURR_PROJ, wantidx, 1); if result: RPR_ShowConsoleMsg("region deleted"); else: RPR_ShowConsoleMsg("region not deleted"); RPR_ShowConsoleMsg("\n"); # add marker pos = 5; isrgn = 0; # not a region rgnend = 8; name = "a marker"; wantidx = 2; # id is here retval = RPR_AddProjectMarker(CURR_PROJ, isrgn, pos, rgnend, name, wantidx); # delete marker result = RPR_DeleteProjectMarker(CURR_PROJ, wantidx, 0); if result: RPR_ShowConsoleMsg("marker deleted"); else: RPR_ShowConsoleMsg("marker not deleted")
See Also
marker: AddProjectMarker, SetProjectMarker, SetProjectMarker2, DeleteProjectMarker, EnumProjectMarkers, EnumProjectMarkers2,
project: GetItemProjectContext, GetProjectPath, GetProjectPathEx, GetProjectTimeSignature, GetProjectTimeSignature2, Main_openProject, SelectProjectInstance, SetProjectMarker, SetProjectMarker2, UpdateItemInProject, plugin_getImportableProjectFilterList, projectconfig_var_addr, projectconfig_var_getoffs, AddProjectMarker, DeleteProjectMarker, EnumProjectMarkers, EnumProjectMarkers2, EnumProjects,
delete: DeleteProjectMarker, DeleteTrack, DeleteTrackMediaItem,
(Section automatically generated, edits may be overwritten.)
Stuff
Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR DeleteProjectMarker
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR DeleteProjectMarker