MP4 Stream Editor exported functions and procedures


Type TMP3SEFuncs holds the addresses. MP3SEFuncsInit() returns these values.

var
  MP3SEFuncs: TMP3SEFuncs;
begin
    //* Get it
    MP3SEFuncs := MP3SEFuncsInit;
    //* Call the Log function
    MP3SEFuncs.Log('Hello', False);

  • RemoveDSP(DSPHandle: HDSP; Channel: DWORD);
  • RemoveDSPbyName(DSPName: String; StreamName: String);
  • Log(Text: String; DebugInfo: Boolean);
  • SetProgress(Value: Integer);
  • GetTempFileName(Extension: String): String;
  • DXError2Str(Err: HResult): String;
  • StatusMsg(Status1, Status2: String);

  • MPEGFrameCopy(FileName: String; FirstFrame: Int64; Frames2copy: Int64; OutFile: String; AppendMode: Boolean): Int64;
  • MPEGCountFrames(FileName: String): Int64;
  • MPEGFindFirstFrame(FileName: String; SearchLength: Integer): Int64;
  • MPEGGetHeader(FileName: String; HeaderPos: Int64): LongWord;
  • MPEGFindNextFrame(FileName: String; SearchPos: Int64): Int64;
  • MPEGGetFrameLength(Header: LongWord): Integer;
  • MPEGGetFrameRate(Header: LongWord): Integer;
  • MPEGProcessHeader(FileName: String; Position: Int64): TMP3StreamHeader;

  • StreamsDSPAdd(Index: Integer; Sync: HDSP; DSPName: String): Boolean;
  • StreamsFindStream(FileName: String): Integer;
  • StreamsBassAcquire(Index: Integer; Force: Boolean): Boolean;
  • StreamsGetInfo(Index: Integer): TBassStreamItem;
  • StreamsSetInfo(Index: Integer; var Stream: TBassStreamItem);
  • StreamsGetList: TBassStreams;
  • StreamsGetListView: TListView;
  • StreamsAdd(FileName: String; URL: Boolean): Boolean;
  • StreamsRemove(Index: Integer): Boolean;
  • StreamsPlay(Index: Integer; StartPos: Int64; FadeIn: Boolean): Boolean;
  • StreamsStop(Index: Integer);
  • StreamsPause(Index: Integer);
  • StreamsListPlay(Index: Integer; FadeIn: Boolean);
  • StreamsListStop;
  • StreamsPicked: Integer;
  • StreamsSetItem(Index: Integer);
  • StreamsQuery: TTagSelection;

  • EncodeListAdd(FileName, OutFileName, EncodeParams, EncodeParamsName, ID3_SourceFileName: String; ID3v1, ID3v2, DeleteAfter: Boolean): Boolean;
  • EncodeListClear;
  • EncodeListProcess;
  • EncodeListGet: TEncodeList;
  • EncodeParamsGet(Query: Boolean): TPresetList;


  • t_RemoveDSP = procedure(DSPHandle: HDSP; Channel: DWORD); stdcall;
    Description: Remove (unassign) DSP from a stream channel
    Parameters: DSPHandle: Bass DSP handle
      Channel: Bass channel handle
    Return value: none
    Remarks: Do not call this function from within a DSP callback with the same channel handle as received by the callback.
    Never try to remove a vis plugin with DSPHandle := 1! Use RemoveDSPbyName() instead!
    See also: RemoveDSPbyName, StreamsGetInfo, StreamsDSPAdd

    :: Top ::


    t_RemoveDSPbyName = procedure(DSPName: String; StreamName: String); stdcall;
    Description: Remove (unassign) DSP or plugin from stream channel by plugin's name
    Parameters: DSPName: Plugin's name
      StreamName: Stream filename (including full path as always)
    Return value: none
    Remarks: Do not call this function from within a DSP callback with the same channel handle as received by the callback.
    See also: RemoveDSP, StreamsGetInfo, StreamsDSPAdd

    :: Top ::


    t_Log = procedure(Text: String; DebugInfo: Boolean); stdcall;
    Description: Log strings
    Parameters: DebugInfo: Displayed only if Debug is True in Settings
    Return value: none
    Remarks:
    See also:

    :: Top ::


    t_SetProgress = procedure(Value: Integer); stdcall;
    Description: Set Processing progress indicator in %
    Parameters: Value: Current progress in percents 0-100
    Return value: none
    Remarks: Set to 0 when finished!
    See also: StatusMsg

    :: Top ::


    t_GetTempFileName = function(Extension: String): String; stdcall;
    Description: Construct a new unique filename in the folder specified in Settings/Temp
    File will be deleted automaticaly on program termination
    Parameters: Extension: File's extension (eg: 'MP3')
    Return value: Unique temp filename
    Remarks: You should delete the file yourself after it's not needed if working with large temp files!
    See also:

    :: Top ::


    t_DXError2Str = function(Err: HResult): String; stdcall;
    Description: Query text description of a DirectX HRESULT Error code. Returns 'Unknown' if DXErr9ab.dll is not found
    Parameters: Err: DirectX result code
    Return value: Description in format "ERROR: DESCRIPTION"
    Remarks: none
    See also:

    :: Top ::


    t_StatusMsg = procedure(Status1, Status2: String); stdcall;
    Description: Set status panel caption. If StatusX = '' then won't change.
    Parameters: Status1, Status2: The text to display
    Return value: None
    Remarks: None
    See also: SetProgress

    :: Top ::


    t_MPEGFrameCopy = function(FileName: String; FirstFrame: Int64; Frames2copy: Int64; OutFile: String; AppendMode: Boolean): Int64; stdcall;
    Description: MPEG frames copy
    Parameters: FileName: Name of file to copy from
      FirstFrame: First frame to copy from, 0: beginning
      Frames2copy: Number of frames to copy, -1: to the end
      OutFile: File to copy to
      AppendMode: if True appends frames to OutFile, False: deletes if OutFile exists
    Return value: Frames succesfully copied
    Remarks: Unregistered version will cut max. 11538 frames ~5mins.
    See also: MPEGCountFrames, MPEGFindFirstFrame, MPEGGetFrameLength

    :: Top ::


    t_MPEGCountFrames = function(FileName: String): Int64; stdcall;
    Description: Count number of MPEG frames in a file
    Parameters: FileName: Name of file
      SearchLength: Max bytes to search from beginning
    Return value: Number of MPEG frames detected in file
    Remarks:
    See also: MPEGFrameCopy, MPEGFindFirstFrame, MPEGGetFrameLength

    :: Top ::


    t_MPEGFindFirstFrame = function(FileName: String; SearchLength: Integer): Int64; stdcall;
    Description: Find First MPEG frame's position in bytes
    Parameters: FileName: Name of file
      SearchLength: Max bytes to search from beginning
    Return value: First MPEG frame's position in bytes
    Remarks:
    See also: MPEGCountFrames, MPEGGetFrameLength

    :: Top ::


    t_MPEGGetHeader = function(FileName: String; HeaderPos: Int64): LongWord; stdcall;
    t_MPEGFindNextFrame = function(FileName: String; SearchPos: Int64): Int64; stdcall;
    t_MPEGGetFrameLength = function(Header: LongWord): Integer; stdcall;
    t_MPEGGetFrameRate = function(Header: LongWord): Integer; stdcall;
    t_MPEGProcessHeader = function(FileName: String; Position: Int64): TMP3StreamHeader; stdcall;
    Description: Seek in MPEG streams with these functions.
    FindFirstFrame, Find next frame, get header from resulting position, ProcessHeader to get a readable frame info.
    Use MPEGGetFrameLength + Position to advance to the next frame logicaly (corrupted frames not tested).
    Parameters: FileName: Name of file
      HeaderPos: MPEG frame header position in bytes
      SearchPos: Position in bytes to search from
      Header: 32bit value use MPEGProcessHeader() to decode
    Return value: Position in bytes, MPEG header bits (Longword), TMP3StreamHeader: decoded MPEG frame header
    type
     TMP3StreamHeader = record
      Position: Int64;    //* Position in bytes
      Header: Longword;   //* The Headers bytes
      FrameLen: Integer;  //* frames length
      MPGver: String;     //* MPEG Version
      MPGlayer: String;   //* MPEG Layer
      MPGCRC: Boolean;    //* Frame has CRC
      MPGrate: Word;      //* frames bitrate
      MPGsmpl: DWord;     //* frames sample rate
      MPGpad: Boolean;    //* frame is padded
      MPGpriv: Boolean;   //* frames private bit is set
      MPGchan: String;    //* frames channel mode
      MPGcopy: Boolean;   //* frames Copy bit is set
      MPGorig: Boolean;   //* frames Original bit is set
      MPGemp: String;     //* frames emphasis mode
    end;
    Remarks:
    See also: MPEGCountFrames, MPEGFindFirstFrame

    :: Top ::


    t_StreamsDSPAdd = function(Index: Integer; Sync: HDSP; DSPName: String): Boolean; stdcall;
    Description: Add DSP plugin to the Stream
    Parameters: Index: Stream's index
      Sync: Bass DSP sync handle
      DSPName: DSP plugin name
    Return value: True: successfuly assigned DSP to stream
    Remarks:
    See also: RemoveDSP, StreamsGetInfo, RemoveDSPbyName

    :: Top ::


    t_StreamsFindStream = function(FileName: String): Integer; stdcall; stdcall;
    Description: Main function for the StreamList, always returns index of the requested Stream
    Parameters: FileName: Stream's filename
    Return value: -1: not found else stream's index
    Remarks:
    See also: StreamsGetInfo, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsQuery

    :: Top ::


    t_StreamsGetInfo = function(Index: Integer): TBassStreamItem; stdcall;
    Description: Get Stream's parameters
    Parameters: Index: Stream's index
    Return value: TBassStreamItem
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsQuery

    :: Top ::


    t_StreamsFindStream = function(FileName: String): Integer; stdcall; stdcall;
    Description: Main function for the StreamList, always returns index of the requested Stream
    Parameters: FileName: Stream's filename
    Return value: -1: not found else stream's index
    Remarks:
    See also: StreamsGetInfo, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsQuery

    :: Top ::


    t_StreamsBassAcquire = function(Index: Integer; Force: Boolean): Boolean; stdcall;
    Description: Create a Bass channel handle for the stream according to it's format MOD, MPG, URL...
    Parameters: Index: Stream's index
      Force: Reinitialize even if alredy acquired
    Return value: False if there was an error
    Remarks: Do not use Force when not needed! It can take minutes to initialize larger streams.
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsQuery

    :: Top ::


    t_StreamsSetInfo = procedure(Index: Integer; var Stream: TBassStreamItem); stdcall;
    Description: Changing Stream parameters is critical, use this function only if you know what you are doing!
    Parameters: Index: Stream's index
      Stream: Stream data, returns the new Stream data (identical to what you sent if succesfull)
    Return value: None
    Remarks: Use this function with care!
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsAdd, StreamsQuery

    :: Top ::


    t_StreamsGetList = function: TBassStreams; stdcall;
    Description: Retrieve the StreamList.
    Parameters: None:
    Return value: TBassStreams
    Remarks: A stream TListItem's index is not equal to TBassStreams index. Use StreamsFindStream(TListItem.Caption) to get the stream index of an Item.
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsQuery

    :: Top ::


    t_StreamsGetListView = function: TListView; stdcall;
    Description: Retrieve the StreamList's ListView.
    Parameters: None:
    Return value: TListView
    Remarks: A stream TListItem's index is not equal to TBassStreams index. Use StreamsFindStream(TListItem.Caption) to get the stream index of an Item.
    If your plugin doesn't use this function, you should comment it out from MP3SE_Types.pas together with the Uses declaration for ComCtrls to prevent linking more than 100K of useless code into your dll.
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsQuery

    :: Top ::


    t_StreamsAdd = function(FileName: String; URL: Boolean): Boolean; stdcall;
    Description: Add files to the StreamList. The way files are added are determined by Settings (Count frames, Init Bass etc.)
    Parameters: FileName: Stream's filename
      URL: True if FileName starts with http:// or ftp://
    Return value: False there was an error
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsQuery

    :: Top ::


    t_StreamsRemove = function(Index: Integer): Boolean; stdcall;
    Description: Remove stream from the StreamList
    Parameters: Index: Stream's index
    Return value: False there was an error
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsQuery

    :: Top ::


    t_StreamsPlay = function(Index: Integer; StartPos: Int64; FadeIn: Boolean): Boolean; stdcall;
    Description: Play particular stream from the StreamList
    Parameters: Index: Stream's index
      StartPos: Starting position in bytes
      FadeIn: If Fade Streams is set it will start with fading in
    Return value: False there was an error
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsStop, StreamsPause, StreamsQuery

    :: Top ::


    t_StreamsStop = procedure(Index: Integer); stdcall;
    Description: Stop playing stream
    Parameters: Index: Stream's index
    Return value: none
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsPlay, StreamsPause, StreamsQuery

    :: Top ::


    t_StreamsPause = procedure(Index: Integer); stdcall;
    Description: Pause playing stream
    Parameters: Index: Stream's index
    Return value: none
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsStop, StreamsPlay, StreamsQuery

    :: Top ::


    t_StreamsListPlay = procedure(Index: Integer; FadeIn: Boolean); stdcall;
    Description: Playlist play StreamList starting from Index
    Parameters: Index: Stream's index
      FadeIn: If Fade Streams is set it will start with fading in
    Return value: none
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsListStop, StreamsQuery

    :: Top ::


    t_StreamsListStop = procedure; stdcall;
    Description: Stop Playlist playing the StreamList
    Parameters: none  
    Return value: none
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsListPlay, StreamsQuery

    :: Top ::


    t_StreamsPicked = function: Integer; stdcall;
    Description: Stop Playlist playing the StreamList
    Parameters: none  
    Return value: First stream the user selected in the StreamList
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsStop, StreamsPlay, StreamsQuery

    :: Top ::


    t_StreamsSetItem = procedure(Index: Integer); stdcall;
    Description: Update stream's info in StreamList (icon, title, artist, etc.)
    Parameters: Index: Stream's index
    Return value: none
    Remarks:
    See also: StreamsFindStream, StreamsPicked, StreamsSetInfo, StreamsAdd, StreamsStop, StreamsPlay, StreamsQuery

    :: Top ::


    t_StreamsQuery = function: TTagSelection; stdcall;
    Description: Popup a dialog and let the user select a Stream from the StreamList
    Parameters: none  
    Return value: TTagSelection.FileName is the filename of the stream the user selected
    Remarks:
    See also: StreamsGetInfo, StreamsPicked, StreamsSetItem, StreamsSetInfo, StreamsAdd, StreamsFindStream

    :: Top ::


    t_EncodeListAdd = function(FileName, OutFileName, EncodeParams, EncodeParamsName, ID3_SourceFileName: String; ID3v1, ID3v2, DeleteAfter: Boolean): Boolean; stdcall;
    Description: Add files to the EncodeList
    Parameters: FileName: Filename to add
      OutFileName: Encode to this file
      EncodeParams: Command line string for Lame.exe (use EncodeParamsGet() for the Preset params)
      EncodeParamsName: Name of the Preset to use for encoding (use EncodeParamsGet() for the Preset names)
      ID3_SourceFileName: Tag the encoded file with Tag(s) from this file
      ID3v1: Use ID3v1 Tag info
      ID3v2: Use ID3v2 Tag info
      DeleteAfter: Delete source file after encoding has finished, regardless if enncoding was succesfull or not
    Return value: none
    Remarks:
    See also: EncodeListClear, EncodeListProcess, EncodeListGet, EncodeParamsGet

    :: Top ::


    t_EncodeListClear = procedure; stdcall;
    Description: Clear the EncodeList
    Parameters: none  
    Return value: none
    Remarks:
    See also: EncodeListAdd, EncodeListProcess, EncodeListGet, EncodeParamsGet

    :: Top ::


    t_EncodeListProcess = procedure; stdcall;
    Description: Start and process the EncodeList
    Parameters: none  
    Return value: none
    Remarks:
    See also: EncodeListAdd, EncodeListClear, EncodeListGet, EncodeParamsGet

    :: Top ::


    t_EncodeListGet = function: TEncodeList; stdcall;
    Description: Retrieve the EncodeList
    Parameters: none  
    Return value: TEncodeList
    Remarks: Read only
    See also: EncodeListAdd, EncodeListProcess, EncodeListClear, EncodeParamsGet

    :: Top ::


    t_EncodeParamsGet = function(Query: Boolean): TPresetList; stdcall;
    Description: Retrieve the PresetList
    Parameters: Query: Popup encoding parameters window
    Return value: TPresetList.PresetIndex stores the index of the preset the user selected use TPresetList.Index[TPresetList.PresetIndex].Params to get the command line parameters
    Remarks:
    See also: EncodeListAdd, EncodeListProcess, EncodeListGet, EncodeListClear


    [Contents] [Home] [E-mail]


    3delite's MP4 Stream Editor Copyright (c) 2003-2021 3delite. All rights reserved.
    BASS 2.0 - Copyright (c) 1999-2020 Ian Luck. All rights reserved.