Jump to content

BASS Function Library (Sound and Music Functions)


BrettF
 Share

Recommended Posts

  • 2 weeks later...

Hi,

First thanks for all the work that's been done with BASS.au3 as well as the other au3s.

I'm using BASS.au3 to play back and mix 5.1 audio from 6 separate mono files which I derive from a stereo source to create what is commonly called an upmix.

To date this is done by processing the audio with various chains of effects and by combining the resulting left and right signals to mono while inverting (reversing phase) one of the two. This is done differently for each of the 6 final mono files which can be previewed and mixed (levels set) with an interface I've created using AutoIt and Bass.au3.

I use this code to create the streams from the mono mixdowns:

$channel1 = _BASS_StreamCreateFile($bass_dll, False, $fileIn1, 0, 0, BitOR($BASS_SAMPLE_MONO, $BASS_SPEAKER_FRONTLEFT))

$channel2 = _BASS_StreamCreateFile($bass_dll, False, $fileIn2, 0, 0, BitOR($BASS_SAMPLE_MONO, $BASS_SPEAKER_FRONTRIGHT))

$channel3 = _BASS_StreamCreateFile($bass_dll, False, $fileIn3, 0, 0, BitOR($BASS_SAMPLE_MONO, $BASS_SPEAKER_CENTER))

$channel4 = _BASS_StreamCreateFile($bass_dll, False, $fileIn4, 0, 0, BitOR($BASS_SAMPLE_MONO, $BASS_SPEAKER_LFE))

$channel5 = _BASS_StreamCreateFile($bass_dll, False, $fileIn5, 0, 0, BitOR($BASS_SAMPLE_MONO, $BASS_SPEAKER_REARLEFT))

$channel6 = _BASS_StreamCreateFile($bass_dll, False, $fileIn6, 0, 0, BitOR($BASS_SAMPLE_MONO, $BASS_SPEAKER_REARRIGHT))

I want to start a new project that will allow streaming of a single stereo file six times simultaneously each to a separately leveled mono mix down assigned to the 6 channels in a 5.1 setup. It will look something like this:

Stereo Source - (left/right +/- mix) - Left Front

Stereo Source - (left/right +/- mix) - Right Front

Stereo Source - (left/right +/- mix) - Center

Stereo Source - (left/right +/- mix) - LFE

Stereo Source - (left/right +/- mix) - Left Surround

Stereo Source - (left/right +/- mix) - Right Surround

My question , if anyone can help me, is can the current BASS.dll do this and if so how? If not, then does anyone know if BassMix.dll can do so? If that is my only recourse, then I'll have to switch to Visual Basic, unless (wishful thinking) anyone (Eukalyptus?) has created a BassMix.au3 and is ready to release soon. :(

Thanks for your help and your time in advance!!!

Joe

Are you experienced?

Link to comment
Share on other sites

I'm not 100% sure on how to do this and I cannot test right now but I can suggest some things.

For making a stereo channel output mono, $BASS_DEVICE_MONO flags should do the trick. Whether or not this will work is another question, as the $BASS_SPEAKER_xxx flags have no effect when the stream is more than stereo...

Give it a try and I'll see about setting something up when I get home and make my computer 5.1ch again :(

Cheers,

Brett

Edit:

Another thought might be using something like this VST plugin in conjunction with BassVST?

Edited by BrettF
Link to comment
Share on other sites

BassMix.au3:

#include-once
#include "Bass.au3"

Global $_ghBassMixDll = -1
Global $BASS_MIX_DLL_UDF_VER = "2.4.6.0"

Global Const $BASS_CONFIG_MIXER_FILTER = 0x10600
Global Const $BASS_CONFIG_MIXER_BUFFER = 0x10601
Global Const $BASS_CONFIG_SPLIT_BUFFER = 0x10610
Global Const $BASS_MIXER_END = 0x10000
Global Const $BASS_MIXER_Nonstop = 0x20000
Global Const $BASS_MIXER_RESUME = 0x1000
Global Const $BASS_MIXER_FILTER = 0x1000
Global Const $BASS_MIXER_BUFFER = 0x2000
Global Const $BASS_MIXER_MATRIX = 0x10000
Global Const $BASS_MIXER_PAUSE = 0x20000
Global Const $BASS_MIXER_DOWNMIX = 0x400000
Global Const $BASS_MIXER_NORAMPIN = 0x800000
Global Const $BASS_MIXER_ENV_FREQ = 1
Global Const $BASS_MIXER_ENV_VOL = 2
Global Const $BASS_MIXER_ENV_PAN = 3
Global Const $BASS_MIXER_ENV_LOOP = 0x10000
Global Const $BASS_SYNC_MIXER_ENVELOPE = 0x10200
Global Const $BASS_CTYPE_STREAM_MIXER = 0x10800
Global Const $BASS_CTYPE_STREAM_SPLIT = 0x10801
Global Const $BASS_MIXER_NODE = "uint64 pos; float value"


; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_MIX_Startup
; Description ...: Starts up BASS functions.
; Syntax.........: _BASS_MIX_Startup($sBassMixDLL)
; Parameters ....:  -   $sBassMixDLL    -   The relative path to BassMix.dll.
; Return values .: Success      - Returns True
;                  Failure      - Returns False and sets @ERROR
;                                   @error will be set to-
;                                       - $BASS_ERR_DLL_NO_EXIST    -   File could not be found.
;                                 If the version of this UDF is not compatabile with this version of Bass, then the following
;                                 error will be displayed to the user.  This can be disabled by setting
;                                       $BASS_STARTUP_BYPASS_VERSIONCHECK = 1
;                                 This is the error show to the user:
;                                       This version of Bass.au3 is not made for Bass.dll VX.X.X.X.  Please update.
; Author ........: Prog@ndy
; Modified.......: Brett Francis (BrettF)
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_MIX_Startup($sBassMixDLL = "bassmix.dll")
    ;Check if bass has already been started up.
    If $_ghBassMixDll <> -1 Then Return True
    ;Check if $sBassDLL exists.
    If Not FileExists($sBassMixDLL) Then Return SetError($BASS_ERR_DLL_NO_EXIST, 0, False)
    ;Check to make sure that the version of Bass.DLL is compatabile with this UDF version.  If not we will throw a text error.
    ;Then we will exit the program
    If $BASS_STARTUP_BYPASS_VERSIONCHECK Then
        If _VersionCompare(FileGetVersion($sBassMixDLL), $BASS_MIX_DLL_UDF_VER) = -1 Then
            MsgBox(0, "ERROR", "This version of BASSMIX.au3 is made for Bassmix.dll V" & $BASS_MIX_DLL_UDF_VER & ".  Please update")
            Exit
        EndIf
    EndIf
    ;Open the DLL
    $_ghBassMixDll = DllOpen($sBassMixDLL)

    ;Check if the DLL was opened correctly.
    Return $_ghBassMixDll <> -1
EndFunc   ;==>_BASS_MIX_Startup



; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelFlags()
; Description ...: Modifies and retrieves a channel's mixer flags.
; Syntax.........: Func _BASS_Mixer_ChannelFlags($handle, $flags, $mask)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $flags          -   A combination of these flags.
;                           -   $BASS_MIXER_BUFFER  Buffer the sample data, for use by BASS_Mixer_ChannelGetData  and BASS_Mixer_ChannelGetLevel.
;                           -   $BASS_MIXER_FILTER  Filter the sample data when resampling.
;                           -   $BASS_MIXER_LIMIT   Limit the mixer processing to the amount of data available from this source. This flag can only be applied to one source per mixer, so it will automatically be removed from any other source of the same mixer.
;                           -   $BASS_MIXER_NORAMPIN    Don't ramp-in the start, including after seeking (BASS_Mixer_ChannelSetPosition).
;                           -   $BASS_MIXER_PAUSE   Pause processing of the source.
;                           -   $BASS_STREAM_AUTOFREE   Automatically free the source channel when it ends.
;                           -   $BASS_SPEAKER_xxx   Speaker assignment flags.
;                   -   $mask           -   The flags (as above) to modify. Flags that are not included in this are left as they are, so it can be set to 0 in order to just retrieve the current flags. To modify the speaker flags, any of the BASS_SPEAKER_
; Return values .: Success      - the channel's updated flags are returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelFlags($handle, $flags, $mask)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "dword", "BASS_Mixer_ChannelFlags", "dword", $handle, "dword", $flags, "dword", $mask)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelFlags

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelGetData()
; Description ...: Retrieves the immediate sample data (or an FFT representation of it) of a mixer source channel.
; Syntax.........: Func _BASS_Mixer_ChannelGetData($handle, $buffer, $length)
; Parameters ....:  -   $handle             -   The channel handle.
;                   -   $buffer             -   Location to write the data.
;                   -   $length             -   Number of bytes wanted, and/or the following flags.
;                           -   $BASS_DATA_FLOAT    Return floating-point sample data.
;                           -   $BASS_DATA_FFT256   256 sample FFT (returns 128 floating-point values)
;                           -   $BASS_DATA_FFT512   512 sample FFT (returns 256 floating-point values)
;                           -   $BASS_DATA_FFT1024  1024 sample FFT (returns 512 floating-point values)
;                           -   $BASS_DATA_FFT2048  2048 sample FFT (returns 1024 floating-point values)
;                           -   $BASS_DATA_FFT4096  4096 sample FFT (returns 2048 floating-point values)
;                           -   $BASS_DATA_FFT8192  8192 sample FFT (returns 4096 floating-point values)
;                           -   $BASS_DATA_FFT_INDIVIDUAL   Use this flag to request separate FFT data for each channel. The size of the data returned (as listed above) is multiplied by the number channels.
;                           -   $BASS_DATA_FFT_NOWINDOW This flag can be used to prevent a Hanning window being applied to the sample data when performing an FFT.
;                           -   $BASS_DATA_AVAILABLE    Query the amount of data the channel has buffered. buffer is ignored when using this flag.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelGetData($handle, $buffer, $length)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "dword", "BASS_Mixer_ChannelGetData", "dword", $handle, "ptr", $buffer, "dword", $length)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelGetData

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelGetEnvelopePos()
; Description ...: Retrieves the current position and value of an envelope on a channel.
; Syntax.........: Func _BASS_Mixer_ChannelGetEnvelopePos($handle, $type, $value)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $type           -   The envelope to get the position/value of. One of the following.
;                           -   $BASS_MIXER_ENV_FREQ    Sample rate.
;                           -   $BASS_MIXER_ENV_VOL Volume.
;                           -   $BASS_MIXER_ENV_PAN Panning/balance.
;                   -   $value          -   Pointer to a variable to receive the envelope value (=float) at the current position... NULL = don't retrieve it.
; Return values .: Success      - the current position of the envelope is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelGetEnvelopePos($handle, $type, $value)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "uint64", "BASS_Mixer_ChannelGetEnvelopePos", "dword", $handle, "dword", $type, "ptr", $value)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelGetEnvelopePos

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelGetLevel()
; Description ...: Retrieves the level (peak amplitude) of a mixer source channel.
; Syntax.........: Func _BASS_Mixer_ChannelGetLevel($handle)
; Parameters ....:  -   $handle         -   The channel handle.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelGetLevel($handle)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "dword", "BASS_Mixer_ChannelGetLevel", "dword", $handle)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelGetLevel

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelGetMatrix()
; Description ...: Retrieves a channel's mixing matrix, if it has one.
; Syntax.........: Func _BASS_Mixer_ChannelGetMatrix($handle, $matrix)
; Parameters ....:  -   $handle             -   The channel handle.
;                   -   $matrix             -   Pointer to a Location (=float) to write the matrix.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelGetMatrix($handle, $matrix)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelGetMatrix", "dword", $handle, "ptr", $matrix)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelGetMatrix

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelGetMixer()
; Description ...: Retrieves the mixer that a channel is plugged into.
; Syntax.........: Func _BASS_Mixer_ChannelGetMixer($handle)
; Parameters ....:  -   $handle             -   The channel handle.
; Return values .: Success      - the mixer stream's handle is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelGetMixer($handle)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "hwnd", "BASS_Mixer_ChannelGetMixer", "dword", $handle)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelGetMixer

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelGetPosition()
; Description ...: Retrieves the playback position of a mixer source channel.
; Syntax.........: Func _BASS_Mixer_ChannelGetPosition($handle, $mode)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $mode           -   How to retrieve the position. One of the following.
;                           -   $BASS_POS_BYTE  Get the position in bytes.
;                           -   $BASS_POS_MUSIC_ORDER   Get the position in orders and rows... LOWORD = order, HIWORD = row * scaler (BASS_ATTRIB_MUSIC_PSCALER). (HMUSIC only)
;                           -   $other modes may be supported by add-ons, see the documentation.
; Return values .: Success      - the channel's position is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelGetPosition($handle, $mode)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "uint64", "BASS_Mixer_ChannelGetPosition", "dword", $handle, "dword", $mode)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelGetPosition

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelRemove()
; Description ...: Unplugs a channel from a mixer.
; Syntax.........: Func _BASS_Mixer_ChannelRemove($handle)
; Parameters ....:  -   $handle             -   The handle of the channel to unplug.
; Return values .: Success      - Returns TRUE
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelRemove($handle)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelRemove", "dword", $handle)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelRemove

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelRemoveSync()
; Description ...: Removes a synchronizer from a mixer source channel.
; Syntax.........: Func _BASS_Mixer_ChannelRemoveSync($handle, $sync)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $sync           -   Handle of the synchronizer to remove.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelRemoveSync($handle, $sync)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelRemoveSync", "dword", $handle, "hwnd", $sync)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelRemoveSync

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelSetEnvelope()
; Description ...: Sets an envelope to modify the sample rate, volume or pan of a channel over a period of time.
; Syntax.........: Func _BASS_Mixer_ChannelSetEnvelope($handle, $type, $count)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $type           -   The attribute to modify with the envelope. One of the following.
;                           -   $BASS_MIXER_ENV_FREQ    Sample rate.
;                           -   $BASS_MIXER_ENV_VOL Volume.
;                           -   $BASS_MIXER_ENV_PAN Panning/balance.
;                           -   $BASS_MIXER_ENV_LOOP    Loop the envelope. This is a flag and can be used in combination with any of the above.
;                   -   $count          -   The number of elements in the nodes array... 0 = no envelope.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelSetEnvelope($handle, $type, $count)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelSetEnvelope", "dword", $handle, "dword", $type, "dword", $count)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelSetEnvelope

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelSetEnvelopePos()
; Description ...: Sets the current position of an envelope on a channel.
; Syntax.........: Func _BASS_Mixer_ChannelSetEnvelopePos($handle, $type, $pos)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $type           -   The envelope to set the position of. One of the following.
;                           -   $BASS_MIXER_ENV_FREQ    Sample rate.
;                           -   $BASS_MIXER_ENV_VOL Volume.
;                           -   $BASS_MIXER_ENV_PAN Panning/balance.
;                   -   $pos            -   The new envelope position, in bytes. If this is beyond the end of the envelope it will be capped or looped, depending on whether the envelope has looping enabled.
; Return values .: Success      - the current position of the envelope is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelSetEnvelopePos($handle, $type, $pos)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelSetEnvelopePos", "dword", $handle, "dword", $type, "uint64", $pos)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelSetEnvelopePos

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelSetMatrix()
; Description ...: Sets a channel's mixing matrix, if it has one.
; Syntax.........: Func _BASS_Mixer_ChannelSetMatrix($handle, $matrix)
; Parameters ....:  -   $handle             -   The channel handle.
;                   -   $matrix             -   Pointer to a Location (= float) of the matrix.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelSetMatrix($handle, $matrix)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelSetMatrix", "dword", $handle, "ptr", $matrix)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelSetMatrix

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelSetPosition()
; Description ...: Sets the playback position of a mixer source channel.
; Syntax.........: Func _BASS_Mixer_ChannelSetPosition($handle, $pos, $mode)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $pos            -   The position, in units determined by the
;                   -   $mode           -   How to set the position. One of the following, with optional flags.
;                           -   $BASS_POS_BYTE  The position is in bytes, which will be rounded down to the nearest sample boundary.
;                           -   $BASS_POS_MUSIC_ORDER   The position is in orders and rows... use MAKELONG(order,row). (HMUSIC only)
;                           -   $BASS_MUSIC_POSRESET    Flag: Stop all notes. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags. (HMUSIC)
;                           -   $BASS_MUSIC_POSRESETEX  Flag: Stop all notes and reset bpm/etc. This flag is applied automatically if it has been set on the channel, eg. via BASS_ChannelFlags. (HMUSIC)
;                           -   $BASS_MIXER_NORAMPIN    Flag: Don't ramp-in the start after seeking. This flag is applied automatically if it has been set on the channel, eg. via BASS_Mixer_ChannelFlags.
;                           -   $other modes & flags may be supported by add-ons, see the documentation.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelSetPosition($handle, $pos, $mode)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_ChannelSetPosition", "dword", $handle, "uint64", $pos, "dword", $mode)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelSetPosition

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_ChannelSetSync()
; Description ...: Sets up a synchronizer on a mixer source channel.
; Syntax.........: Func _BASS_Mixer_ChannelSetSync($handle, $type, $param, $user)
; Parameters ....:  -   $handle         -   The channel handle.
;                   -   $type           -   The type of sync. This can be one of the standard sync types, as available via
;                   -   $param          -   The sync parameter.
;                   -   $user           -   User instance data to pass to the callback function.
; Return values .: Success      - the new synchronizer's handle is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_ChannelSetSync($handle, $type, $param, $user)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "hwnd", "BASS_Mixer_ChannelSetSync", "dword", $handle, "dword", $type, "uint64", $param, "ptr", $user)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_ChannelSetSync

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_GetVersion()
; Description ...: Retrieves the version of BASSmix that is loaded.
; Syntax.........: Func _BASS_Mixer_GetVersion()
; Parameters ....:  -
; Return values .: Success      - Returns The BASSmix version. For example, 0x02040103 (hex), would be version 2.4.1.3
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_GetVersion()
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "dword", "BASS_Mixer_GetVersion")
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_GetVersion

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_StreamAddChannel()
; Description ...: Plugs a channel into a mixer.
; Syntax.........: Func _BASS_Mixer_StreamAddChannel($handle, $channel, $flags)
; Parameters ....:  -   $handle             -   The mixer handle.
;                   -   $channel            -   The handle of the channel to plug into the mixer... a HMUSIC, HSTREAM or HRECORD.
;                   -   $flags          -   Any combination of these flags.
;                           -   $BASS_MIXER_MATRIX  Creates a channel matrix, allowing the source's channels to be sent to any of the mixer output channels, at any levels. The matrix can be retrieved and modified via the BASS_Mixer_ChannelGetMatrix  and BASS_Mixer_ChannelSetMatrix  functions. The matrix will initially contain a one-to-one mapping, eg. left out = left in, right out = right in, etc...
;                           -   $BASS_MIXER_DOWNMIX If the source has more channels than the mixer output (and the mixer is stereo or mono), then a channel matrix is created, initialized with the appropriate downmixing matrix. Note the source data is assumed to follow the standard channel ordering, as described in the STREAMPROC documentation.
;                           -   $BASS_MIXER_BUFFER  Buffer the sample data, for use by BASS_Mixer_ChannelGetData and BASS_Mixer_ChannelGetLevel. This increases memory requirements, so should not be enabled needlessly. The size of the buffer can be controlled via the BASS_CONFIG_MIXER_BUFFER config option.
;                           -   $BASS_MIXER_FILTER  Filter the sample data when resampling, to reduce aliasing. This improves the sound quality, particularly when resampling to or from a low sample rate, but requires more processing. The precision of the filtering can be controlled via the BASS_CONFIG_MIXER_FILTER config option.
;                           -   $BASS_MIXER_LIMIT   Limit the mixer processing to the amount of data available from this source, while the source is active (not ended). If the source stalls, then the mixer will too, rather than continuing to mix other sources, as it would normally do. This flag can only be applied to one source per mixer, so it will automatically be removed from any other source of the same mixer.
;                           -   $BASS_MIXER_NORAMPIN    Don't ramp-in the start, including after seeking (BASS_Mixer_ChannelSetPosition). This is useful for gap-less playback, where a source channel is intended to seamlessly follow another. This does not affect volume and pan changes, which are always ramped.
;                           -   $BASS_MIXER_PAUSE   Pause processing of the source. Use BASS_Mixer_ChannelFlags to resume processing.
;                           -   $BASS_STREAM_AUTOFREE   Automatically free the source channel when it ends. This allows you to add a channel to a mixer and forget about it, as it will automatically be freed when it has reached the end, or when the source is removed from the mixer or when the mixer is freed.
;                           -   $BASS_SPEAKER_xxx   Speaker assignment flags. Ignored when using the BASS_MIXER_MATRIX or BASS_MIXER_DOWNMIX flag. The BASS_Init BASS_DEVICE_NOSPEAKER flag has effect here.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_StreamAddChannel($handle, $channel, $flags)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_StreamAddChannel", "hwnd", $handle, "dword", $channel, "dword", $flags)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_StreamAddChannel

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_StreamAddChannelEx()
; Description ...: Plugs a channel into a mixer, optionally delaying the start and limiting the length.
; Syntax.........: Func _BASS_Mixer_StreamAddChannelEx($handle, $channel, $length)
; Parameters ....:  -   $handle             -   The mixer handle.
;                   -   $channel            -   The handle of the channel to plug into the mixer... a HMUSIC, HSTREAM or HRECORD.
;                   -   $flags              -   Any combination of these flags.
;                           -   $BASS_MIXER_MATRIX  Creates a channel matrix, allowing the source's channels to be sent to any of the mixer output channels, at any levels. The matrix can be retrieved and modified via the BASS_Mixer_ChannelGetMatrix  and BASS_Mixer_ChannelSetMatrix  functions. The matrix will initially contain a one-to-one mapping, eg. left out = left in, right out = right in, etc...
;                           -   $BASS_MIXER_DOWNMIX If the source has more channels than the mixer output (and the mixer is stereo or mono), then a channel matrix is created, initialized with the appropriate downmixing matrix. Note the source data is assumed to follow the standard channel ordering, as described in the STREAMPROC documentation.
;                           -   $BASS_MIXER_BUFFER  Buffer the sample data, for use by BASS_Mixer_ChannelGetData and BASS_Mixer_ChannelGetLevel. This increases memory requirements, so should not be enabled needlessly. The size of the buffer can be controlled via the BASS_CONFIG_MIXER_BUFFER config option.
;                           -   $BASS_MIXER_FILTER  Filter the sample data when resampling, to reduce aliasing. This improves the sound quality, particularly when resampling to or from a low sample rate, but requires more processing. The precision of the filtering can be controlled via the BASS_CONFIG_MIXER_FILTER config option.
;                           -   $BASS_MIXER_LIMIT   Limit the mixer processing to the amount of data available from this source, while the source is active (not ended). If the source stalls, then the mixer will too, rather than continuing to mix other sources, as it would normally do. This flag can only be applied to one source per mixer, so it will automatically be removed from any other source of the same mixer.
;                           -   $BASS_MIXER_NORAMPIN    Don't ramp-in the start, including after seeking (BASS_Mixer_ChannelSetPosition). This is useful for gap-less playback, where a source channel is intended to seamlessly follow another. This does not affect volume and pan changes, which are always ramped.
;                           -   $BASS_MIXER_PAUSE   Pause processing of the source. Use BASS_Mixer_ChannelFlags to resume processing.
;                           -   $BASS_STREAM_AUTOFREE   Automatically free the source channel when it ends. This allows you to add a channel to a mixer and forget about it, as it will automatically be freed when it has reached the end, or when the source is removed from the mixer or when the mixer is freed.
;                           -   $BASS_SPEAKER_xxx   Speaker assignment flags. Ignored when using the BASS_MIXER_MATRIX or BASS_MIXER_DOWNMIX flag. The BASS_Init BASS_DEVICE_NOSPEAKER flag has effect here.
;                   -   $start              -   Delay (in bytes) before the channel is mixed in.
;                   -   $length             -   The maximum amount of data (in bytes) to mix... 0 = no limit. Once this end point is reached, the channel will be removed from the mixer.

; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_StreamAddChannelEx($handle, $channel, $flags, $start, $length)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Mixer_StreamAddChannelEx", "hwnd", $handle, "dword", $channel, "uint64", $length)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_StreamAddChannelEx

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Mixer_StreamCreate()
; Description ...: Creates a mixer stream.
; Syntax.........: Func _BASS_Mixer_StreamCreate($freq, $chans, $flags)
; Parameters ....:  -   $freq           -   The sample rate of the mixer output.
;                   -   $chans          -   The number of channels... 1 = mono, 2 = stereo, 4 = quadraphonic, 6 = 5.1, 8 = 7.1.
;                   -   $flags          -   Any combination of these flags.
;                           -   $BASS_SAMPLE_8BITS Produce 8 - bit output. If neither this Or the BASS_SAMPLE_FLOAT flags are specified, Then the stream is 16 - bit.
;                           -   $BASS_SAMPLE_FLOAT Produce 32 - bit floating - point output. WDM drivers Or the BASS_STREAM_DECODE flag are required To use this flag In Windows. See Floating - point channels For more info.
;                           -   $BASS_SAMPLE_SOFTWARE Force the stream To Not use hardware mixing. Note this only applies To playback of the mixer's output; the mixing of the source channels is always performed by BASSmix.
;                           -   $BASS_SAMPLE_3D Use 3D functionality. This requires that the BASS_DEVICE_3D flag was specified when calling BASS_Init, And the stream must be mono(chans = 1). The SPEAKER flags can Not be used together With this flag.
;                           -   $BASS_SAMPLE_FX
;                           -   $requires DirectX 8 Or above Enable the old implementation of DirectX 8 effects. See the DX8 effect implementations section For details. Use BASS_ChannelSetFX To add effects To the stream.
;                           -   $BASS_MIXER_END End the stream when there are no active(including stalled) source channels, Else it is never - ending.
;                           -   $BASS_MIXER_Nonstop Don't stop producing output when there are no active source channels, else it will be stalled until there are active sources.
;                           -   $BASS_MIXER_RESUME When stalled, resume the mixer immediately upon a new Or unpaused source, Else it will be resumed at the Next update cycle.
;                           -   $BASS_STREAM_AUTOFREE Automatically free the stream when playback ends.
;                           -   $BASS_STREAM_DECODE Mix the sample data, without playing it. Use BASS_ChannelGetData To retrieve the mixed sample data. The BASS_SAMPLE_3D, BASS_STREAM_AUTOFREE And SPEAKER flags can Not be used together With this flag. The BASS_SAMPLE_SOFTWARE, BASS_SAMPLE_FX And BASS_MIXER_RESUME flags are also ignored.
;                           -   $BASS_SPEAKER_xxx Speaker assignment flags. These flags have no effect when the stream is more than stereo.
; Return values .: Success      - the new stream's handle is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Mixer_StreamCreate($freq, $chans, $flags)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "hwnd", "BASS_Mixer_StreamCreate", "dword", $freq, "dword", $chans, "dword", $flags)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Mixer_StreamCreate

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Split_StreamCreate()
; Description ...: Creates a splitter stream.
; Syntax.........: Func _BASS_Split_StreamCreate($channel, $flags, $chanmap)
; Parameters ....:  -   $channel        -   The handle of the channel to split... a HMUSIC, HSTREAM or HRECORD.
;                   -   $flags          -   Any combination of these flags.
;                           -   $BASS_SAMPLE_SOFTWARE Force the stream To Not use hardware mixing.
;                           -   $BASS_SAMPLE_3D Use 3D functionality. This requires that the BASS_DEVICE_3D flag was specified when calling BASS_Init, And the stream must be mono. The SPEAKER flags can Not be used together With this flag.
;                           -   $BASS_SAMPLE_FX
;                           -   $requires DirectX 8 Or above Enable the old implementation of DirectX 8 effects. See the DX8 effect implementations section For details. Use BASS_ChannelSetFX To add effects To the stream.
;                           -   $BASS_STREAM_AUTOFREE Automatically free the stream when playback ends.
;                           -   $BASS_STREAM_DECODE Render the sample data, without playing it. Use BASS_ChannelGetData To retrieve the sample data. The BASS_SAMPLE_3D, BASS_STREAM_AUTOFREE And SPEAKER flags can Not be used together With this flag. The BASS_SAMPLE_SOFTWARE And BASS_SAMPLE_FX flags are also ignored.
;                           -   $BASS_SPEAKER_xxx Speaker assignment flags. These flags have no effect when the stream is more than stereo.
;                   -   $chanmap        -   Channel mapping... pointer to an array of channel indexes (0=first, -1=end of array), NULL = a 1:1 mapping of the source.
; Return values .: Success      - the new stream's handle is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Split_StreamCreate($channel, $flags, $chanmap)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "hwnd", "BASS_Split_StreamCreate", "dword", $channel, "dword", $flags, "ptr", $chanmap)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Split_StreamCreate

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Split_StreamGetSource()
; Description ...: Retrieves the source of a splitter stream.
; Syntax.........: Func _BASS_Split_StreamGetSource($handle)
; Parameters ....:  -   $handle             -   The splitter stream handle.
; Return values .: Success      - the source channel's handle is returned.
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Split_StreamGetSource($handle)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "dword", "BASS_Split_StreamGetSource", "hwnd", $handle)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Split_StreamGetSource

; #FUNCTION# ====================================================================================================================
; Name...........: Func _BASS_Split_StreamReset()
; Description ...: Resets a splitter stream or all splitter streams of a source.
; Syntax.........: Func _BASS_Split_StreamReset($handle)
; Parameters ....:  -   $handle             -   The splitter or source handle.
; Return values .: Success      - Returns True
;                  Failure      - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Eukalyptus
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Split_StreamReset($handle)
    Local $BASS_ret_ = DllCall($_ghBassMixDll, "int", "BASS_Split_StreamReset", "dword", $handle)
    If @error Then Return SetError(1, 1, 0)
    If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(), 0, 0)
    Return $BASS_ret_[0]
EndFunc   ;==>_BASS_Split_StreamReset

This version is NOT tested!

I´ve created this UDF by extracting the informations from the bassmix.chm :(

Link to comment
Share on other sites

OK i'm tring to get BASSTags to work while streaming a .pls from shoutcast. I can get the shoutcast to stream and all.. What i can't get is the BassTags to work.. morless update... I'm a noob at autoit, just asking for a lil help? i think the _BASS_Free() is closing them both.? is there a way to do this._BASS_Free()?

Link to comment
Share on other sites

Ok i couldn't find an edit button to edit my last post, but i did find this function....

$NameList = ""

$NameList = _BASS_ChannelGetTags($MusicHandle, $BASS_TAG_META)

GUICtrlSetData(5,""&$NameList)

and its only replying a hex number such as... 0x01DAA300

Its a shoutcast steam also using DNAS.

Link to comment
Share on other sites

Ok i couldn't find an edit button to edit my last post, but i did find this function....

$NameList = ""

$NameList = _BASS_ChannelGetTags($MusicHandle, $BASS_TAG_META)

GUICtrlSetData(5,""&$NameList)

and its only replying a hex number such as... 0x01DAA300

Its a shoutcast steam also using DNAS.

Please provide a sample script replicating the problem (or your current, whatever you prefer) so I can take a look.

Cheers,

Brett

Link to comment
Share on other sites

func GetMp3Tag()
    $id3_ptr = _BASS_ChannelGetTags($MusicHandle, $BASS_TAG_META)

Local $struct = DllStructCreate("char v0[3]; char v1[130];char v2[30];char v3[30];char v4[4];char v5[30];char v6[1]", $id3_ptr)

$id3_ptr_text = DllStructGetData($struct, 1)
$STag = $id3_ptr_text ; Not Used
$id3_ptr_text = DllStructGetData($struct, 2)
$STitle = $id3_ptr_text
$id3_ptr_text = DllStructGetData($struct, 3)
$SArtist = $id3_ptr_text
$id3_ptr_text = DllStructGetData($struct, 4)
$S1 = $id3_ptr_text ;Website.com
$id3_ptr_text = DllStructGetData($struct, 5)
$S2 = $id3_ptr_text ;Not Used Ever
$id3_ptr_text = DllStructGetData($struct, 6)
$S3 = $id3_ptr_text ;Not Used Ever
$NameList = ""
$info = StringTrimLeft($STitle&"", 10)
$result = StringInStr($info&"", ";",1)
;NameList = $result
$NameList = Stringleft($info,($result - 2))
;$NameList = $STitle
IF $NameList = "" then 
    $NameList = "No Stream Loaded"
EndIf
ControlSetText($window, "", $Artist, $NameList) ; $Namelist is the actual artist/and title
;$Artist is the control variable ex: $artist = GUICtrlCreateInput("No Stream Loaded.",105,16,230)
EndFunc

Although right now i would like a way to have the text scroll, i tried using but it just makes the gui stop responding cause of the delay of 100, if i set to 0 it scrolls to fast. need a way to do multithread, or even multiprocess that evals vars.

Func texteffect($winhandle, $control_id, $text = "", $delay = 100, $static = 0)
    Opt ("WinTitleMatchMode", 4)
    
    If $text <> "" Then
        For $i = StringLen($text) to 0 Step - 1
            If $static Then GUISetState(@SW_LOCK)
            ControlSetText($winhandle, "", $control_id, StringRight($text, $i))
            Sleep($delay)
            If $static Then GUISetState(@SW_UNLOCK)
        Next
        Return 1
    Else
        Return 0
    EndIf
EndFunc  ;==>_txt_eff__slide_left
Link to comment
Share on other sites

For ID3, there is already a library called BassTags or so. It simplifies reading of ID3-tags :(

It is also included in the AutoIt-BASS-archive

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

For ID3, there is already a library called BassTags or so. It simplifies reading of ID3-tags :(

It is also included in the AutoIt-BASS-archive

yea i know, i couldn't get that work... The id3 tags are working its the fact that some of the song names are longer than the input box, so i'd like it to scroll now. thats the only thing from keeping this project being done for now.
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 4 weeks later...

I have ran most examples and I must say, this is damn cool :idea:

There is one particular example, the most interesting one, the recorder, which didn't want to run.

Quite a bit of errors aswell. I am using the latest AutoIt.

C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(21,34) : ERROR: _BASS_ASIO_GetRate() called with wrong number of args.
$Samplerate = _BASS_ASIO_GetRate()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(225,40) : REF: definition of _BASS_ASIO_GetRate().
Func _BASS_ASIO_GetRate($bass_asio_dll)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(25,32) : ERROR: _BASS_ASIO_GetInfo() called with wrong number of args.
$Channels = _BASS_ASIO_GetInfo()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(200,40) : REF: definition of _BASS_ASIO_GetInfo().
Func _BASS_ASIO_GetInfo($bass_asio_dll)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(29,67) : ERROR: _BASS_ASIO_CB_ChannelEnable() called with wrong number of args.
_BASS_ASIO_CB_ChannelEnable($bass_asio_cb_dll, 1, 0, $StreamHandle)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(92,60) : REF: definition of _BASS_ASIO_CB_ChannelEnable().
Func _BASS_ASIO_CB_ChannelEnable($input, $channel, $handle)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(30,31) : ERROR: _BASS_ASIO_ChannelJoin() called with wrong number of args.
_BASS_ASIO_ChannelJoin(1, 1, 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(347,73) : REF: definition of _BASS_ASIO_ChannelJoin().
Func _BASS_ASIO_ChannelJoin($bass_asio_dll, $input, $channel, $channel2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(31,58) : ERROR: _BASS_ASIO_ChannelSetFormat() called with wrong number of args.
_BASS_ASIO_ChannelSetFormat(1, 0, $BASS_ASIO_FORMAT_16BIT)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(377,76) : REF: definition of _BASS_ASIO_ChannelSetFormat().
Func _BASS_ASIO_ChannelSetFormat($bass_asio_dll, $input, $channel, $format)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(32,58) : ERROR: _BASS_ASIO_ChannelSetFormat() called with wrong number of args.
_BASS_ASIO_ChannelSetFormat(1, 1, $BASS_ASIO_FORMAT_16BIT)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(377,76) : REF: definition of _BASS_ASIO_ChannelSetFormat().
Func _BASS_ASIO_ChannelSetFormat($bass_asio_dll, $input, $channel, $format)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(33,30) : ERROR: _BASS_ASIO_Start() called with wrong number of args.
_BASS_ASIO_Start($Channels[6])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(235,47) : REF: definition of _BASS_ASIO_Start().
Func _BASS_ASIO_Start($bass_asio_dll, $buflen)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(37,43) : ERROR: _BASS_ASIO_ChannelGetLevel() called with wrong number of args.
    $levelL = _BASS_ASIO_ChannelGetLevel(1, 0)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(437,66) : REF: definition of _BASS_ASIO_ChannelGetLevel().
Func _BASS_ASIO_ChannelGetLevel($bass_asio_dll, $input, $channel)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(38,43) : ERROR: _BASS_ASIO_ChannelGetLevel() called with wrong number of args.
    $levelR = _BASS_ASIO_ChannelGetLevel(1, 1)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(437,66) : REF: definition of _BASS_ASIO_ChannelGetLevel().
Func _BASS_ASIO_ChannelGetLevel($bass_asio_dll, $input, $channel)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(44,17) : ERROR: _BASS_ASIO_Free() called with wrong number of args.
_BASS_ASIO_Free()
~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\BASSASIO.au3(180,37) : REF: definition of _BASS_ASIO_Free().
Func _BASS_ASIO_Free($bass_asio_dll)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3(6,19) : ERROR: _BASS_ENC_STARTUP(): undefined function.
_BASS_ENC_STARTUP()
~~~~~~~~~~~~~~~~~~^
C:\Documents and Settings\Lars\Skrivbord\BASS\BASS.au3\BASS_ASIO\example_record.au3 - 11 error(s), 0 warning(s)
Edited by Zisly
Link to comment
Share on other sites

Hi,

Was away camping for the long weekend so I haven't been at a computer for a few days. I will be able to look at it when I get home so we will see whats happening with it.

Cheers,

Brett

Link to comment
Share on other sites

Trying the Bass_Ext example, the example works.

But when I replace

$file = "http://stream.transmissionfm.com:8000/breaks-high.mp3"

with

$file = "http://212.227.65.62:8110"

I get "Could not load audio file Error = 41"

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

Google Translate

Hello people.

My name - com_1

I was able to build(collect) and reconcile(connect) - Explorer & Media Player.

I hope someone handy(usefull).

Sorry, no English only - Russian

Господа, присоединяйтесь. (кто-нибудь подкачайте)

С миру по нитке и будет программа.

#include <GuiConstantsEx.au3>
#include <GuiMenu.au3>
#include <GuiListView.au3>
#include <GuiButton.au3>
#include <GuiSlider.au3>
#include <Sound.au3>
#include <StaticConstants.au3>
#include <Misc.au3>

Global $msg
Global $dir = @ScriptDir
Global $desx = @DesktopWidth, $desy = @DesktopHeight
Global $scrx = (640), $scry = (480/2)
Global $d; loop
Global $o1_dost, $o2_dost; dostup

; open window
Global $Gui = GUICreate("AutoIT prog_1", $scrx, $scry)

; c, d, e
Global $HDD = DriveGetDrive("All")

; menu
Global $s_item[$HDD[0]]
Global $o1_a

; search
Global $search = GUICtrlCreateMenu("&Search")
For $d = 1 To $HDD[0]; for >
    $s_item[$d-1] = GUICtrlCreateMenuItem("&" & StringUpper($HDD[$d]) & "      ", $search)
Next; for <

; options
Global $options = GUICtrlCreateMenu("&Options")
    GUICtrlSetState(-1, $GUI_DISABLE)

; help
Global $help = GUICtrlCreateMenu("&Help")
    GUICtrlSetState(-1, $GUI_DISABLE)

; text - dir
Global $label_1 = GUICtrlCreateLabel($dir, 5, 5, $scrx-5+300, 13)
    GUICtrlSetFont(-1, 10, 100, 0, "Lucida Console")
    GUICtrlSetState(-1, $GUI_DISABLE)

; explorer
Global $o2_split1, $o2_split2, $o2_split3, $o2_split4
Global $o2_search, $o2_file, $o2_text
Global $o2_n
Global $o2_a, $o2_b
Global $o2_new
Global $o2_st1, $o2_st2

; button
Global $bx = 2, $by = ($scry-42), $brx = 60, $bry = 20

; play
Global $b_play = GUICtrlCreateButton("Play", $bx, $by, $brx, $bry)
    GUICtrlSetState(-1, $GUI_DISABLE)

; pause
Global $b_pause = GUICtrlCreateButton("Pause", ($bx+($brx*1)), $by, $brx, $bry)
    GUICtrlSetState(-1, $GUI_DISABLE)

; stop
Global $b_stop = GUICtrlCreateButton("Stop", ($bx+($brx*2)), $by, $brx, $bry)
    GUICtrlSetState(-1, $GUI_DISABLE)

; text - timeline
Global $o4_a, $o4_st
Global $label_2 = GUICtrlCreateLabel($o4_a, 250, $by+5, 100, 20)
    GUICtrlSetFont(-1, 10, 100, 0, "Lucida Console")
    GUICtrlSetState(-1, $GUI_DISABLE)

; slider - time line
Global $slider = GUICtrlCreateSlider(338, $by, 300, 20, $TBS_NOTICKS)
Global $o5_i1, $o5_i2, $o5_i3
Global $o5_st, $o5_st2
Global $o5_kas, $o5_a, $o5_len, $o5_split
Global $o5_n1, $o5_n2, $o5_n3

; music
Global $sound, $s_status = "?"

; text - visualizaton
Global $label_3 = GUICtrlCreateLabel("no comment", $scrx-0-100+50, 20, 100-2-50, $scry-4-38-22+1, 0x12)

; visualization - graphics
Global $o6kl = 19-2-11
Global $o6_i[$o6kl]
Global $o6_x1[$o6kl], $o6_y1[$o6kl], $o6_rx[$o6kl], $o6_ry[$o6kl]
Global $o6_t[$o6kl], $o6_st[$o6kl]
Global $o6_x[$o6kl], $o6_mx[$o6kl]
Global $o6_dost = "no", $o6_st2

; graphics
For $d = 0 To $o6kl - 1; for >
    ; pos.
    $o6_x1[$d] = $scrx-100+53+($d*7)
    $o6_y1[$d] = $scry-45
    $o6_rx[$d] = 7
    $o6_ry[$d] = 1

    ; risunok
    $o6_i[$d] = GUICtrlCreateGraphic($o6_x1[$d], $o6_y1[$d], $o6_rx[$d], $o6_ry[$d])

    ; color
    GUICtrlSetBkColor($o6_i[$d], 0xFFFFFF)
    GUICtrlSetColor($o6_i[$d], 0x999999)
Next; for <

; keyboard & mouse
Global $dll = DllOpen("user32.dll")

; mouse pos.
Global $mouse, $mx, $my, $mbl, $mbr
Global $mx2 = (($desx-$scrx)/2), $my2 = (($desy-$scry)/2)

; window ok.
GUISetState()


;__________________________________________________________________________________________________________________________
Do
$msg = GUIGetMsg()

; function
menu()
explorer()
m_buttons()
mouse()
m_timeline()
visualization()

Sleep(25)
Until $msg = $GUI_EVENT_CLOSE
;__________________________________________________________________________________________________________________________


;__________________________________________________________________________________________________________________________
Func menu(); func ->

; press button - search
For $d = 1 To $HDD[0]; for >
    If $msg = $s_item[$d-1] Then

        $o1_a = StringUpper($HDD[$d] & "\")
        GUICtrlSetData($label_1, $o1_a)

        $o2_st1 = 1
        $o2_st2 = 1

        $dir = $o1_a
        $o2_new = "yes"

        _SoundStop($sound)
        _SoundClose($sound)
        $s_status = "stopping"

        If $o4_a = "yes" Then $o6_dost = "stop"

        $o4_a = "no"
        $o4_st = 0

$o5_st2 = "pause"

    EndIf
Next; for <

EndFunc; func <-

;__________________________________________________________________________________________________________________________
Func explorer(); func ->

if $o2_dost = 0 Then; dostup >
    $o2_dost = 1

    If FileExists($dir) = 1 Then; exist >

        ; open list
        Global $ListView = GUICtrlCreateListView("", 2, 20, $scrx-4-100+50, $scry-4-38-22, BitOR(0x0002,0x0004,0x0010))

        ; smena pos.
        FileChangeDir($dir)

        ; sbros na 0
        $o2_split1 = ""
        $o2_split2 = ""
        $o2_split3 = ""
        $o2_split4 = ""
        $o2_search = ""
        $o2_file = ""
        $o2_text = ""
        $o2_n = ""
        $o2_a = ""
        $o2_b = ""
        $o2_new = "no"

        ; split 1
        $o2_split1 = StringSplit($dir, "\")

        ; poisk po sisteme
        $o2_search = FileFindFirstFile("*.*")

        ; kl-vo objectov
        While 1; loop >
            $o2_file = FileFindNextFile($o2_search)
            ; na vixod
            If @error Then ExitLoop

            ; split 3
            $o2_split3 = StringSplit($o2_file, ".")

            If     StringInStr(FileGetAttrib($dir & $o2_file), "D") Then
                $o2_text = $o2_text & $o2_file & "\"
            ElseIf $o2_split3[$o2_split3[0]] = "mp3" Or $o2_split3[$o2_split3[0]] = "wav" Then
                $o2_text = $o2_text & $o2_file & "\"
            EndIf
        WEnd; loop <

        ; close - file
        FileClose($search)

        ; split 2
        $o2_split2 = StringSplit($o2_text, "\")

        Global $o2n[$o2_split2[0]]

        ; create explorer back
        If $o2_split1[0]>2 Then
            $o2_n = GUICtrlCreateListViewItem(" [..] ", $ListView)
        EndIf

        ; create explorer list
        For $d = 1 To $o2_split2[0]-1; for >
            $o2n[$d] = GUICtrlCreateListViewItem($o2_split2[$d], $ListView)
        Next; for <

        ; text - dir
        GUICtrlSetData($label_1, $dir)

    EndIf; exist <

EndIf; dostup <


; explorer - back
If $o2_split1[0]>2 Then; back >
    If $msg = $o2_n Then; msg >

        _SoundStop($sound)
        _SoundClose($sound)
        $s_status = "stopping"

        ; po sisteme - nasad
        If     $o2_st1 = 1 Then
            $o2_a = ($o2_split1[0]-1)
        ElseIf $o2_st1 = 0 Then
            $o2_st1 = 1
            $o2_st2 = 1
            $o2_a = ($o2_split1[0]-0)
        EndIf

        For $d = 1 To $o2_split1[0]-0; for >
            If $d < $o2_a Then $o2_b = $o2_b & $o2_split1[$d] & "\"
        Next; for <

        $dir = $o2_b
        $o2_new = "yes"

        If $o4_a = "yes" Then $o6_dost = "stop"

        $o4_a = "no"
        $o4_st = 0

        $o5_st2 = "pause"

    EndIf; msg <
EndIf; back <


; explorer - next
For $d = 1 To $o2_split2[0]-1; for >
    If $msg = $o2n[$d] Then; msg >

        _SoundStop($sound)
        _SoundClose($sound)

        ; tip objecta
        $o2_split4 = StringSplit(GUICtrlRead($msg, $GUI_CHECKED), ".")

        ; po sisteme - dalshe
        If StringInStr(FileGetAttrib(GUICtrlRead($msg, $GUI_CHECKED)), "D") <> 0 Then; attrib >

            If     $o2_st2 = 1 Then
                $o2_b = $dir & GUICtrlRead($msg, $GUI_CHECKED) & "\"
            ElseIf $o2_st2 = 0 Then
                $o2_st2 = 1
                $o2_st1 = 1
                $o2_b = $dir & "\" & GUICtrlRead($msg, $GUI_CHECKED) & "\"
            EndIf

            $dir = $o2_b
            $o2_new = "yes"

            $s_status = "stopping"

            $o4_a = "no"
            $o4_st = 0

            $o6_dost = "stop"

            $o5_st2 = "pause"

        EndIf; attrib <

        ; play music
        If $o2_split4[$o2_split4[0]] = "mp3" Or $o2_split4[$o2_split4[0]] = "wav" Then

            ; open sound
            $sound = _SoundOpen($dir & GUICtrlRead($msg, $GUI_CHECKED))
            _SoundPlay($sound, 0)

            $s_status = "playing"

            $o4_a = "yes"
            $o4_st = 0

            $o6_dost = "play"

            $o5_st2 = "no pause"

        EndIf

    EndIf; msg <
Next; for <


; delete & load new explorer
If $o2_new = "yes" Then
    
    GUICtrlDelete($ListView)

    $o2_dost = 0

EndIf

EndFunc; func <-

;__________________________________________________________________________________________________________________________
Func m_buttons(); func ->

; open & close button - music
If     $s_status = "playing" Then
    $s_status = "?"
    GUICtrlSetState($b_play, $GUI_ENABLE)
    GUICtrlSetState($b_pause, $GUI_ENABLE)
    GUICtrlSetState($b_stop, $GUI_ENABLE)
ElseIf $s_status = "stopping" Then
    $s_status = "?"
    GUICtrlSetState($b_play, $GUI_DISABLE)
    GUICtrlSetState($b_pause, $GUI_DISABLE)
    GUICtrlSetState($b_stop, $GUI_DISABLE)
EndIf


; press button - music
If     $msg = $b_play Then
    _SoundPlay($sound, 0)
    $o6_dost = "play"
    $o5_st2 = "no pause"
ElseIf $msg = $b_pause Then
    _SoundPause($sound)
    If $o6_dost = "play" Then
        $o6_dost = "pause"
    EndIf
    $o5_st2 = "pause"
ElseIf $msg = $b_stop Then
    _SoundStop($sound)
    $o6_dost = "stop"
EndIf


; text - sound timeline
If $o4_a = "yes" Then 
    GUICtrlSetData($label_2, _SoundPos($sound, 1))
Else
    If $o4_st = 0 Then
    $o4_st = 1
    GUICtrlSetData($label_2, "no music")
EndIf
EndIf

EndFunc; func <-

;__________________________________________________________________________________________________________________________
Func m_timeline(); func ->

; kasanie
If $mbl = 0 Then
    If $mx > 340 And $my > $scry-22 And $mx < $scrx-2 And $my < $scry-4 Then
        $o5_kas = 1
    Else
        $o5_kas = 0
    EndIf
EndIf


; press button - ok.
If $o5_kas = 1 Then
    If $o5_st = 0 Then
        If $mbl = 1 Then $o5_st = 1
    EndIf
EndIf


; timeline pos. - smena pos. objecta
If     $o5_st = 0 Then; stop >

    ; dvisenie - avtomatom
    $o5_i1 = (100 / _SoundLength($sound, 2))
    $o5_i2 = ($o5_i1 * _SoundPos($sound, 2))

    ; predel po x - na 0
    If $o5_i2 <= 0 Then $o5_i2 = 0

    ; predel po x - na max
    If _SoundPos($sound, 2) >= _SoundLength($sound, 2) Then
        If $o6_st2 = 0 Then
            $o6_st2 = 1
            $o6_dost = "stop"
        EndIf

    Else
    $o6_st2 = 0
    EndIf

    ; timeline pos.
    _GUICtrlSlider_SetPos($slider, $o5_i2)

ElseIf $o5_st = 1 Then; stop >
    $o5_st = 2

    If $o6_dost = "play" Or $o6_dost = "pause" Then
        _SoundPause($sound)
        $o6_dost = "pause"
    EndIf

ElseIf $o5_st = 2 Then; stop >

    ; smena pos.
    $o5_a = ((_GUICtrlSlider_GetPos($slider) / $o5_i1) / 1000)

    ; split
    $o5_split = StringSplit($o5_a, ".")

    If $mbl = 0 Then; mb >
        $o5_st = 0

        ; new timeline pos.
        $o5_n1 = "00"
        $o5_n2 = "00"
        $o5_n3 = "00"

        For $d = 0 To $o5_split[1]-1; for >

            $o5_n1 = $o5_n1 + 1
            If $o5_n1 >= 60 Then
                $o5_n1 = 0
                $o5_n2 = $o5_n2 + 1
                If $o5_n2 >= 60 Then
                    $o5_n2 = 0
                    $o5_n3 = $o5_n3 + 1
                EndIf
            EndIf

        Next; for <

    If $o6_dost = "play" Or $o6_dost = "pause" Then
        _SoundSeek($sound, $o5_n3, $o5_n2, $o5_n1)

        If $o5_st2 = "no pause" Then
            _SoundPlay($sound, 0)
            $o6_dost = "play"
        EndIf

    EndIf

EndIf; mb <

EndIf; stop <

EndFunc; func <-

;__________________________________________________________________________________________________________________________
Func visualization(); func ->

For $d = 0 To $o6kl - 1; for >
    If     $o6_dost = "play" Then; dost >

        If $o6_t[$d] < 1 Then; timer >
            $o6_t[$d] = $o6_t[$d] + 1
        Else
            $o6_t[$d] = 0
            $o6_x[$d] = Random(1,100,0)
        EndIf; timer <

        $o6_st[$d] = 0

    ElseIf $o6_dost = "stop" Then; dost >

        If $o6_st[$d] = 0 Then

            If $o6_t[$d] < 5 Then; timer >
                $o6_t[$d] = $o6_t[$d] + 1
            Else
                If $o6_x[$d] > 0 Then
                    $o6_x[$d] = $o6_x[$d] - 0.5 + $o6_mx[$d]
                    $o6_mx[$d] = $o6_mx[$d] - 0.5
                Else
                    $o6_st[$d] = 1
                    $o6_t[$d] = 0
                    $o6_x[$d] = 0
                    $o6_mx[$d] = 0
                EndIf
            EndIf; timer <

        EndIf

    EndIf; dost <

Next; for <


For $d = 0 To $o6kl - 1; for >
    ; risunok
    GUICtrlSetPos($o6_i[$d], $o6_x1[$d], $o6_y1[$d]-$o6_x[$d], $o6_rx[$d], $o6_ry[$d]+($o6_x[$d]))
Next; for <

EndFunc; func <-

;__________________________________________________________________________________________________________________________
Func mouse(); func ->

; mouse
$mouse = MouseGetPos()
$mx = $mouse[0] - $mx2
$my = $mouse[1] - $my2
$mbl = 0
$mbr = 0

If _IsPressed("01", $dll) Then $mbl = 1
If _IsPressed("02", $dll) Then $mbr = 1

EndFunc; func <-


; delete
_SoundClose($sound)
DllClose($dll)
GUIDelete()
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...