content top

Initialization And Deinitialization – Giavapps Game Jolt API

Initialization And Deinitialization – Giavapps Game Jolt API

  About Initialization And Deinitialization Functions   You must call gj_init() before any other function from Giavapps Game Jolt API Extension. You must also call gj_deinit() for deinitializing the Extension and free memory occupied.   Initialization And Deinitialization Functions   gj_init(string game_id, string private_key) Initializes Giavapps Game Jolt API Extension and all local variables. Please note that this function also stores the Game ID and Private Key values inside gj_game_id and gj_private_key local variables. You can find these values on http://gamejolt.com under Dashboard > Your Games > (Select Your Game) > Game API > API Settings. string game_id: the Game ID of the game. string private_key: the Private Key of the game.   gj_deinit() Deinitializes Giavapps Game Jolt API Extension and frees memory occupied.   Local Variables   Once you called gj_init() function you gain access to the following local variables: string gj_game_id contains the Game ID. (Default: "") string gj_private_key contains the Private Key. (Default: "") string gj_username contains the User Name. (Default: "") string gj_user_token contains the User Token. (Default: "") double gj_alarm_id contains the id of the Alarm that will be used for pinging an open Session. (Default: 0) double gj_alarm_time contains the number of steps for the Alarm that will be used for pinging an open Session. (Default: 30*room_speed) string gj_success contains the result data of the success field received when sending HTTP requests to the Game Jolt API. (Default: "false") string gj_message contains the result data of the message field received when sending HTTP requests to the Game Jolt API. (Default: "")   Code Examples   Initializing And Deinitializing Giavapps Game Jolt API Extension   Create Event   gj_init("game_id","private_key");//Initializes Giavapps Game Jolt API   Game End Event   gj_deinit();//Deinitializes Giavapps Game Jolt API   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Data Store – Giavapps Game Jolt API

Data Store – Giavapps Game Jolt API

  About Data Store Functions   For more info about Data Store functions please visit the following link: http://gamejolt.com/api/doc/game/data-store   Score Functions   gj_datastore_fetch_global(string key) Returns data from the Data Store. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/fetch string key: the key of the data item you’d like to fetch.   gj_datastore_fetch_user(string key) Returns data from the Data Store for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/fetch string key: the key of the data item you’d like to fetch.   gj_datastore_set_global(string key, string data) Sets data in the Data Store. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/set string key: the key of the data item you’d like to set. string data: the data you’d like to set.   gj_datastore_set_user(string key, string data) Sets data in the Data Store for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/set string key: the key of the data item you’d like to set. string data: the data you’d like to set.   gj_datastore_update_global(string key, string operation, string value) Updates data in the Data Store. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/update string key: the key of the data item you’d like to update. string operation: the operation that you’d like to perform. The mathematic operations are add, subtract, multiply and divide. The string operations are append and prepend. string value: the value that you’d like to work with on the data store.   gj_datastore_update_user(string key, string operation, string value) Updates data in the Data Store for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/update string key: the key of the data item you’d like to update. string operation: the operation that you’d like to perform. The mathematic operations are add, subtract, multiply and divide. The string operations are append and prepend. string value: the value that you’d like to work with on the data store.   gj_datastore_remove_global(string key) Removes data from the Data Store. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/remove string key: the key of the data item you’d like to remove.   gj_datastore_remove_user(string key) Removes data from the Data Store for the user. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/remove string key: the key of the data item you’d like to remove.   gj_datastore_get_keys_global() Returns all the keys in the game’s global Data Store. This function returns the id of the HTTP request. For more info: http://gamejolt.com/api/doc/game/data-store/get-keys   gj_datastore_get_keys_user() Returns all the keys in...

Read More

Giavapps.MIDI.Error Class

Giavapps.MIDI.Error Class

  About Giavapps.MIDI.Error Class   Giavapps.MIDI.Error class is mainly used for retrieving error messages.   Giavapps.MIDI.Error Class Methods   Giavapps.MIDI.Error.ManualChecking( bool ManualChecking ) specifies if Giavapps MIDI should store data about detected errors in order that you can then check that data through Giavapps.MIDI.Error.* functions. By default this feature is disabled. When this feature is enabled you must always loop through all received data by calling Giavapps.MIDI.Error.Count() (usually inside Update() or Coroutine methods). If an application continues sending errors and you are not processing them you may cause a memory leak. (See Code Examples below for more info about how to manual check errors correctly). When this feature is disabled, Giavapps MIDI will stop storing data for errors. You can leave disabled this feature if you are not going to use any of the Giavapps.MIDI.Error.* functions. bool ManualChecking: enable (true) or disable (false) manual check.   Giavapps.MIDI.Error.Count() returns the amount of detected errors. Use the other Giavapps.MIDI.Error.* functions to get info about the messages. When you call this function Giavapps MIDI will free data stored for errors (see Giavapps.MIDI.Error.ManualChecking() function for more info).   Giavapps.MIDI.Error.String( double ErrorIndex ) returns the specified error string. double ErrorIndex: zero-based index of the error.   Code Example using System.Collections; using System.Collections.Generic; using UnityEngine; public class CodeExample : MonoBehaviour { void Awake() { Giavapps.MIDI.Initialize();//Initializes Giavapps MIDI extension Giavapps.MIDI.Error.ManualChecking(true);//Enables manual checking of error messages Giavapps.MIDI.Input.Device.Open(2);//Opens the third MIDI Input Device ("Oxygen 49" MIDI Keyboard in my case) } void Update() { //Check for error messages double errors = Giavapps.MIDI.Error.Count(); for(double e = 0; e < errors; e++) { Debug.Log(Giavapps.MIDI.Error.String(e));//Prints an error message } if(Input.GetKeyUp(KeyCode.Space)) { Giavapps.MIDI.Input.Device.Open(2);//Ops! This causes an error! } } void OnApplicationQuit() { Giavapps.MIDI.Deinitialize();//Deinitializes Giavapps MIDI extension } }   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Giavapps.MIDI.Output.Message Class

Giavapps.MIDI.Output.Message Class

  About Giavapps.MIDI.Output.Message Class   Giavapps.MIDI.Output.Message class is mainly used for sending MIDI Messages to MIDI Output devices.   Giavapps.MIDI.Output.Message Class Methods   Giavapps.MIDI.Output.Message.Clear() clears the MIDI Message Buffer. This function removes all bytes previously stored in the MIDI Message Buffer.   Giavapps.MIDI.Output.Message.Size() returns the amount of bytes stored in the MIDI Message Buffer.   Giavapps.MIDI.Output.Message.Byte( byte Byte) Adds one byte to the MIDI Message Buffer. byte Byte: value from 0 to 255.   Giavapps.MIDI.Output.Message.Send() sends the MIDI Message Buffer previously created with Giavapps.MIDI.Output.Message.* functions to the open MIDI Output device.   Code Example using System.Collections; using System.Collections.Generic; using UnityEngine; public class CodeExample : MonoBehaviour { void Awake() { Giavapps.MIDI.Initialize();//Initializes Giavapps MIDI extension Giavapps.MIDI.Output.Device.Open(0);//Opens the first MIDI Output Device ("Microsoft GS Wavetable Synth" by default on Windows) } void Update() { if(Input.GetKeyUp(KeyCode.Space)) { //NOTE C5 ON – CHANNEL 1 – VELOCITY 100 Giavapps.MIDI.Output.Message.Clear();//Clears the MIDI Message buffer Giavapps.MIDI.Output.Message.Byte(144);//Adds one byte to the MIDI Message buffer Giavapps.MIDI.Output.Message.Byte(60);//Adds one byte to the MIDI Message buffer Giavapps.MIDI.Output.Message.Byte(100);//Adds one byte to the MIDI Message buffer Giavapps.MIDI.Output.Message.Send();//Sends the MIDI Message to the MIDI Output Device } } void OnApplicationQuit() { Giavapps.MIDI.Deinitialize();//Deinitializes Giavapps MIDI extension } }   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Giavapps.MIDI.Input.Message Class

Giavapps.MIDI.Input.Message Class

  About Giavapps.MIDI.Input.Message Class   Giavapps.MIDI.Input.Message class is mainly used for receiving MIDI Messages from MIDI Input devices.   Giavapps.MIDI.Input.Message Class Methods   Giavapps.MIDI.Input.Message.ManualChecking( bool ManualChecking ) specifies if Giavapps MIDI should store data about detected MIDI Messages in order that you can then check that data through Giavapps.MIDI.Input.Message.* functions. By default this feature is disabled. When this feature is enabled you must always loop through all received data by calling Giavapps.MIDI.Input.Message.Count() (usually inside Update() or Coroutine methods). If a MIDI device continues sending MIDI Messages and you are not processing them you may cause a memory leak. (See Code Examples below for more info about how to manual check MIDI Messages correctly). When this feature is disabled, Giavapps MIDI will stop storing data for MIDI Messages. You can leave disabled this feature if you are not going to use any of the Giavapps.MIDI.Input.Message.* functions. bool ManualChecking: enable (true) or disable (false) manual check.   Giavapps.MIDI.Input.Message.Type( bool Sysex, bool Time, bool Sense) specify whether certain MIDI Message Types should be queued or ignored during input. bool Sysex: enable (true) or disable (false) System Exclusive messages. bool Time: enable (true) or disable (false) Timing messages. bool Sense: enable (true) or disable (false) Active Sensing messages.   Giavapps.MIDI.Input.Message.Count() returns the amount of messages from an open MIDI Input device. Use the other Giavapps.MIDI.Input.Message.* functions to get info about the messages. When you call this function Giavapps MIDI will free data stored for MIDI Messages (see Giavapps.MIDI.Input.Message.ManualChecking() function for more info).   Giavapps.MIDI.Input.Message.Size( double MessageIndex ) returns the amout of bytes of the specified MIDI Message. double MessageIndex: zero-based index of the MIDI Message.   Giavapps.MIDI.Input.Message.Byte( double MessageIndex, double ByteIndex) Returns the specified byte (0-255) from the given MIDI Message. double MessageIndex: zero-based index of the MIDI Message. double ByteIndex: zero-based index of the byte.   Giavapps.MIDI.Input.Message.Time( double MessageIndex ) returns the amount of time passed since the previous MIDI Message was received. double MessageIndex: zero-based index of the MIDI Message.   Code Example using System.Collections; using System.Collections.Generic; using UnityEngine; public class CodeExample : MonoBehaviour { void Awake() { Giavapps.MIDI.Initialize();//Initializes Giavapps MIDI extension Giavapps.MIDI.Input.Message.Open(2);//Opens the third MIDI Input Device ("Oxygen 49" MIDI Keyboard in my case) Giavapps.MIDI.Output.Device.Open(0);//Opens the first MIDI Output Device ("Microsoft GS Wavetable Synth" by default on Windows) Giavapps.MIDI.Input.Message.AutoMessage(true);//Sends all received MIDI Input Messages to the MIDI Output Device ("Oxygen 49" >>> "Microsoft GS Wavetable Synth" in my case) Giavapps.MIDI.Input.Message.ManualChecking(true);//Enables manual checking of MIDI Messages Giavapps.MIDI.Input.Message.Type(true,true,true);//Enables all MIDI Messages Types } void Update() { //Prints all received MIDI Messages double messages = Giavapps.MIDI.Input.Message.Count(); for(double m = 0; m < messages; m++) { double time = Giavapps.MIDI.Input.Message.Time(m); double size = Giavapps.MIDI.Input.Message.Size(m); string bytes = “”; for(double...

Read More

Giavapps.MIDI.Output.Device Class

Giavapps.MIDI.Output.Device Class

  About Giavapps.MIDI.Output.Device Class   Giavapps.MIDI.Output.Device class is mainly used for retreiving information about MIDI Output devices and for opening and closing MIDI Output devices.   Giavapps.MIDI.Output.Device Class Methods   Giavapps.MIDI.Output.Device.Count() returns the amount of connected MIDI Output devices. This function detects connected MIDI Output devices.   Giavapps.MIDI.Output.Device.Name( int DeviceIndex ) returns a string identifier for the specified MIDI Output device and number. int DeviceIndex: zero-based index of the device.   Giavapps.MIDI.Output.Device.Open( int DeviceIndex ) opens the specified MIDI Output device. Only open devices can receive messages. int DeviceIndex: zero-based index of the device.   Giavapps.MIDI.Output.Device.IsOpen() returns true if a MIDI Output device is open and false if not.   Giavapps.MIDI.Output.Device.Close() closes an open MIDI Output device (if exists).   Code Example using System.Collections; using System.Collections.Generic; using UnityEngine; public class CodeExample : MonoBehaviour { void Awake() { Giavapps.MIDI.Initialize(); //Prints all available MIDI Input devices Debug.Log("MIDI INPUT DEVICES:"); int i; for(i=0; i < Giavapps.MIDI.Input.Device.Count(); i++) { Debug.Log(Giavapps.MIDI.Input.Device.Name(i)); } //Prints all available MIDI Output devices Debug.Log("MIDI OUTPUT DEVICES:"); for(i=0; i < Giavapps.MIDI.Output.Device.Count(); i++) { Debug.Log(Giavapps.MIDI.Output.Device.Name(i)); } Giavapps.MIDI.Input.Device.Open(2);//Opens the third MIDI Input Device ("Oxygen 49" MIDI Keyboard in my case) Giavapps.MIDI.Output.Device.Open(0);//Opens the first MIDI Output Device ("Microsoft GS Wavetable Synth" by default on Windows) Giavapps.MIDI.Input.Device.AutoMessage(true);//Sends all received MIDI Input Messages to the MIDI Output Device ("Oxygen 49" >>> "Microsoft GS Wavetable Synth" in my case) } void OnApplicationQuit() { Giavapps.MIDI.Deinitialize(); } }   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More
content top