Results 1 to 3 of 3

Thread: Need to Play Amiga MOD files from VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    9

    Question

    I'm writing a nice program for kids and would like to include Amiga MOD files. Has anybody heard of a way to do this?

    Thanx

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Use the ModPlug plugin (from www.modplug.com). This is from a site I saw ages ago:
    First, you must have NPMOD32.DLL in your application
    directory, or provide the path where the file is located.

    OK. To get a basic player window up that loops the MOD
    over and over, put these declarations in a module.

    ******************************************************

    Declare Function ModPlug_CreateEx Lib "npmod32.dll" (ByVal lpszArgs As String) As Long
    Declare Function ModPlug_Destroy Lib "npmod32.dll" (ByVal pPlugin As Long) As Long
    Declare Function ModPlug_SetWindow Lib "npmod32.dll" (ByVal pPlugin As Long, ByVal hwnd As Integer) As Long
    Declare Function ModPlug_Load Lib "npmod32.dll" (ByVal pPlugin As Long, ByVal lpszFileName As String) As Long
    Declare Function ModPlug_Play Lib "npmod32.dll" (ByVal pPlugin As Long) As Long
    Declare Function ModPlug_Stop Lib "npmod32.dll" (ByVal pPlugin As Long) As Long
    Declare Function ModPlug_SetCurrentPosition Lib "npmod32.dll" (ByVal plugin As Long, ByVal nPos As Long) As Long
    Declare Function ModPlug_GetCurrentPosition Lib "npmod32.dll" (ByVal plugin As Long) As Long
    Declare Function ModPlug_GetVersion Lib "npmod32.dll" () As Long
    * 1.91+ *
    Declare Function ModPlug_SetVolume Lib "npmod32.dll" (ByVal plugin As Long, ByVal vol As Long) As Long

    ******************************************************

    ******************************************************

    Put this code in the general declarations section of the form.



    ******************************************************

    Dim RetVal As Long
    Dim ModFileName$

    ******************************************************



    Then, put this code somewhere. This code can go anywhere in your
    application that you see fit. However, I like to put it
    in a command button.

    ******************************************************

    Private Sub Command1_Click()


    ' EXTREMELY IMPORTANT FIRST STEP
    ' In order to get a MOD playing, you have to
    ' first create the plugin. Note that this
    ' does not actually display the plugin. However,
    ' this returned value is so important that we give
    ' it variable RetVal.

    RetVal = ModPlug_CreateEx ("loop|true")

    ' This next step gives the newly-created plugin
    ' a window hWnd to use. This return value
    ' isn't important; therefore, we give it variable
    ' x.

    X = ModPlug_SetWindow (RetVal, Form1.hWnd)

    ' This next step loads the MOD. The MOD can be
    ' of any type that the ModPlug Player supports.
    ' (MOD/S3M/IT/XM/669...)

    ModFileName$ = "MYMOD.MOD" 'remember to include full
    'path if MOD is not in app
    'directory

    X = ModPlug_Load (RetVal, ModFileName$)

    'If all goes well, you can now play the MOD.

    X = ModPlug_Play (RetVal)

    End Sub

    ******************************************************

    To stop the MOD, use ModPlug_Stop (it should be
    pretty self-explanatory.)

    When your application ends, or you want to completely
    stop the MOD Plugin, use this:

    ******************************************************

    Private Sub Command2_Click()


    'Stop the plugin.
    X = ModPlug_Stop(RetVal)

    'Now, destroy the plugin window...

    X = ModPlug_Destroy(RetVal)

    End Sub

    ******************************************************

    That's it! I would post a sample application with all
    the code and stuff, but all of the .DLLs that VB applications
    require make for a hefty download...
    not to mention version incompatiblities.

    ******************************************************


    -- David Yip
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    New Member
    Join Date
    Aug 2003
    Posts
    15
    Is there any way to play a MOD file without including extra files like DLL ?

    Do u have any tricks?

    Thanks.
    -_-_- Knowledge Is The Power -_-_-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width