Go Back   Cockos Incorporated Forums > REAPER Forums > ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum

Reply
 
Thread Tools Display Modes
Old 05-24-2018, 08:18 AM   #1
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default how to distinguish media item between midi, rpp, or audio file?

i was expecting something in GetMediaItemInfo_Value to give me this information, but can't find anything
Maybe with the source file name?
Thanks!
deeb is online now   Reply With Quote
Old 05-24-2018, 08:55 AM   #2
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

Get the media source from the take (not the item, since the take is what owns the source) with GetMediaItemTake_Source, then the source type with GetMediaSourceType.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Xenakios is offline   Reply With Quote
Old 05-24-2018, 08:55 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,629
Default

You can use the MediaItemStateChunks and parse the <Source line out.

I try to update the StateChunk-docs currently(not online yet), so this excerpts may be helpful:

Quote:
<SOURCE string fileformat
...
>
<SOURCE signals the format of the media-source. The content of the tagblock SOURCE will be defined by the mediaformat used.
This is in addition(!) to a possible <SOURCE SECTION>, which is described above!
Most formats use FILE "path/filename.ext" but others, like MIDI, VIDEO or VIDEOEFFECT have additional or other settings within this tag.
string fileformat - FLAC, MP3, WAVE, DDP, VORBIS, OPUS, WAVPACK, MIDI, VIDEO, VIDEOEFFECT
for AIFF as well as CUE(AudioCD-Image)-files, Reaper uses WAVE as fileformat!
Haven't done that for subprojects yet...

Important: There could be a <SOURCE SECTION-line as well, so keep in mind that both may appear in the StateChunk!
Meo-Ada Mespotine is online now   Reply With Quote
Old 05-24-2018, 09:12 AM   #4
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,820
Default

ahh Thank you both! State chunk is not need for the thing i am aiming! I'll go with the APi source take! Thank you thank you thank you! : )
deeb is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:33 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.