Sound::getTag (FMOD_Sound_GetTag) [Updated]

Anfängerfragen zum Programmieren mit PureBasic.
Benutzeravatar
R4z0r1989
Beiträge: 521
Registriert: 12.06.2005 18:06
Kontaktdaten:

Sound::getTag (FMOD_Sound_GetTag) [Updated]

Beitrag von R4z0r1989 »

Hey Jungs und Mädls,

ich werde jetzt vielleicht auf Gelächter stoßen, aber ich verzweifle grad daran eine Float als Parameter nach FMOD zu bringen. Und zwar genau an dieser Stelle:

Code: Alles auswählen

...
Global fmod_decka_volume.f = 0.0
...
fmod_decka_volume = GetGadgetState(#TrackBar_DeckA_Volume)/100
CallFunction(0, "FMOD_Channel_SetVolume", fmod_decka_channel, fmod_decka_volume.f)
...
Ich bin für wirklich jede Hilfe dankbar.


MFG R4z0r1989
Zuletzt geändert von R4z0r1989 am 08.03.2011 22:29, insgesamt 1-mal geändert.
Benutzeravatar
ts-soft
Beiträge: 22292
Registriert: 08.09.2004 00:57
Computerausstattung: Mainboard: MSI 970A-G43
CPU: AMD FX-6300 Six-Core Processor
GraKa: GeForce GTX 750 Ti, 2 GB
Memory: 16 GB DDR3-1600 - Dual Channel
Wohnort: Berlin

Re: Float als Parameter für FMOD

Beitrag von ts-soft »

Code: Alles auswählen

Prototype Channel_SetVolume(fmod_decka_channel, fmod_decka_volume.f)
...
Global FMOD_Channel_SetVolume.Channel_SetVolume = GetFunction(0, "FMOD_Channel_SetVolume")
Global fmod_decka_volume.f = 0.0
...
fmod_decka_volume = GetGadgetState(#TrackBar_DeckA_Volume)/100
FMOD_Channel_SetVolume(fmod_decka_channel, fmod_decka_volume.f)
... 
PureBasic 5.73 LTS | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Nutella hat nur sehr wenig Vitamine. Deswegen muss man davon relativ viel essen.
Bild
Benutzeravatar
Kiffi
Beiträge: 10711
Registriert: 08.09.2004 08:21
Wohnort: Amphibios 9

Re: Float als Parameter für FMOD

Beitrag von Kiffi »

<OT>
@R4z0r1989: Überprüfe mal Deine Signatur
</OT>

Grüße ... Kiffi
a²+b²=mc²
Benutzeravatar
R4z0r1989
Beiträge: 521
Registriert: 12.06.2005 18:06
Kontaktdaten:

Re: Float als Parameter für FMOD

Beitrag von R4z0r1989 »

danke dir hat prima funktioniert :-)

hab jetzt ein andres Problem. Ich steig nicht so ganz dahinter wie ich an die Tags(Interpret,Titel,Jahr,ect.) bekomm.
Laut FMOD Referenz heisst der Befehl Sound::getTag (FMOD_Sound_GetTag)
Ich bin mal wieder für jede Hilfe dankbar.

MFG R4z0r1989

PS ich nutz die DLL direkt, also ohne Wrapper oder Lib.
PSS hier die der auszug aus der doku:

Code: Alles auswählen

Sound::getTag
Retrieves a descriptive tag stored by the sound, to describe things like the song name, author etc.  

C++ Syntax

FMOD_RESULT Sound::getTag(
  const char *  name, 
  int  index, 
  FMOD_TAG *  tag
);

C Syntax

FMOD_RESULT FMOD_Sound_GetTag(
  FMOD_SOUND *  sound,
  const char *  name, 
  int  index, 
  FMOD_TAG *  tag
);

Parameters

name

Optional. Name of a tag to retrieve. Used to specify a particular tag if the user requires it. To get all types of tags leave this parameter as 0 or NULL. 

index

Index into the tag list. If the name parameter is null, then the index is the index into all tags present, from 0 up to but not including the numtags value returned by Sound::getNumTags.
If name is not null, then index is the index from 0 up to the number of tags with the same name. For example if there were 2 tags with the name "TITLE" then you could use 0 and 1 to reference them.
Specifying an index of -1 returns new or updated tags. This can be used to pull tags out as they are added or updated. 

tag

Pointer to a tag structure. This will receive 

 

Return Values

If the function succeeds then the return value is FMOD_OK.
If the function fails then the return value will be one of the values defined in the FMOD_RESULT enumeration.


 

Remarks

The number of tags available can be found with Sound::getNumTags. The way to display or retrieve tags can be done in 3 different ways.
All tags can be continuously retrieved by looping from 0 to the numtags value in Sound::getNumTags - 1. Updated tags will refresh automatically, and the 'updated' member of the FMOD_TAG structure will be set to true if a tag has been updated, due to something like a netstream changing the song name for example.
Tags could also be retrieved by specifying -1 as the index and only updating tags that are returned. If all tags are retrieved and this function is called the function will return an error of FMOD_ERR_TAGNOTFOUND.
Specific tags can be retrieved by specifying a name parameter. The index can be 0 based or -1 in the same fashion as described previously. 

Und hier noch die Structure:

Code: Alles auswählen

FMOD_TAG
Structure describing a piece of tag data.  


Structure

typedef struct {
  FMOD_TAGTYPE  type;
  FMOD_TAGDATATYPE  datatype;
  char *  name;
  void *  data;
  unsigned int  datalen;
  FMOD_BOOL  updated;
} FMOD_TAG;

Members

type

[r] The type of this tag. 

datatype

[r] The type of data that this tag contains 

name

[r] The name of this tag i.e. "TITLE", "ARTIST" etc. 

data

[r] Pointer to the tag data - its format is determined by the datatype member 

datalen

[r] Length of the data contained in this tag 

updated

[r] True if this tag has been updated since last being accessed with Sound::getTag 

 

Remarks

Members marked with [r] mean the variable is modified by FMOD and is for reading purposes only. Do not change this value.
Members marked with [w] mean the variable can be written to. The user can set the value.

Antworten