Author Topic: Direct bass : Vb.net (vb2008, vb2010, vb6, vc#, vc++, devC++, delphi, AutoIt)  (Read 181501 times)

sak2005

  • Posts: 998
Tip: How to create F# Form Application ::) Get full project : Clickhere

1. Open new Console application
2. Open properties project and changing.. Output type to.. Windows Application
3. Addded Type class MainForm to empty project
4. References System windows form (Open)
5. Added sub new fuction and add construct operators
6. Created and add controls to the mainform

Example:
Code: [Select]
#light

//using namespace
open System
open System.IO
open System.Data
open System.Drawing
open System.Threading
open System.Windows.Forms
open System.ComponentModel
open System.Runtime.InteropServices

//created Module
module BASS =         
  module private Imported =
     [<DllImport( "bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_Init")>]
     extern bool _Init(int device, int freq, int flags, IntPtr win, IntPtr clsid)
     [<DllImport( "bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_StreamCreateFile")>]
     extern int _StreamCreateFile(bool mem, string file, int64 offset, int64 length, int flags)
     [<DllImport( "bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_ChannelPlay")>]
     extern bool _ChannelPlay(int handle, bool restart)
     [<DllImport( "bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_StreamFree")>]
     extern bool _StreamFree(int handle)
     [<DllImport( "bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_Free")>]
     extern bool _Free()
     
  let BASS_Init(device, freq, flags, win) =
      Imported._Init(device, freq, flags, win, IntPtr.Zero)
  let BASS_StreamCreateFile(file, offset, length, flags) =
      Imported._StreamCreateFile(false, file, offset, length, flags)
  let BASS_ChannelPlay(handle, restart) =
      Imported._ChannelPlay(handle, restart)
  let BASS_Free() =
      Imported._Free()
  let BASS_StreamFree(handle) =
      Imported._StreamFree(handle)
  //end module
 
//created Form
type MainForm =
     inherit Form
     val mutable components : System.ComponentModel.IContainer
     val mutable ofdOpen : System.Windows.Forms.OpenFileDialog
     val mutable btnLoad : System.Windows.Forms.Button
     val mutable strm : int
     val mutable file : string 
   
     override this.Dispose (disposing) =
           if disposing && (this.components <> null) then
              this.components.Dispose ()
           base.Dispose (disposing)
     
     member this.InitializeComponent () =
            this.components <- new System.ComponentModel.Container ()
            this.ofdOpen <- new System.Windows.Forms.OpenFileDialog ()
            this.btnLoad <- new System.Windows.Forms.Button ()
            this.SuspendLayout ()
            // OpenFileDialog
            this.ofdOpen.Filter <- "Media Files(*.wav;*.mp3)|.*wav;*.mp3"
            // Button1
            this.btnLoad.Name <- "Button1"
            this.btnLoad.Text <- "Load"
            this.btnLoad.Size <- new Size(60, 25)
            this.btnLoad.Location <- new Point(5, 185)
            this.btnLoad.Cursor <- Cursors.Hand
            this.btnLoad.Click.AddHandler(new System.EventHandler (fun s e -> this.btnLoad_Click(s, e)))
            // Form1
            this.Name <- "Form1"
            this.Text <- "F#FormApp"
            this.StartPosition <- FormStartPosition.CenterScreen
            this.AutoSizeMode <- AutoSizeMode.GrowAndShrink
            this.MaximizeBox <- false
            this.AutoScaleDimensions <- new System.Drawing.SizeF (6.0f, 13.0f)
            this.AutoScaleMode <- System.Windows.Forms.AutoScaleMode.Font
            this.ClientSize <- new System.Drawing.Size (267, 220)
            this.Controls.Add(this.btnLoad)
            this.FormClosing.AddHandler(new System.Windows.Forms.FormClosingEventHandler (fun s e -> this.MainForm_FormClosing(s, e)))
            this.ResumeLayout (false)
   
     member this.btnLoad_Click (sender : System.Object, e : EventArgs) =
            if this.ofdOpen.ShowDialog() = DialogResult.OK then
               if this.strm <> 0 then BASS.BASS_StreamFree(this.strm)|>ignore
               this.file <- this.ofdOpen.FileName
               this.strm <- BASS.BASS_StreamCreateFile(this.file, int64(0), int64(0), 0x80000000 ||| 4)
               BASS.BASS_ChannelPlay(this.strm, false)|>ignore
     
     member this.MainForm_FormClosing (sender : System.Object, e : FormClosingEventArgs) =
            BASS.BASS_Free()|>ignore
             
     new () as this =
          {
              components = null;
              ofdOpen = null;
              btnLoad = null;
              strm = 0;
              file = "";
          }
              then
              this.InitializeComponent()
              BASS.BASS_Init(-1, 44100, 0, this.Handle)|>ignore
              //end Form

//create startup
[<STAThread>]
let main() =
    Application.EnableVisualStyles()
    Application.SetCompatibleTextRenderingDefault(false)
    Application.Run(new MainForm())
[<STAThread>]
main()
//ens startup

« Last Edit: 5 Oct '17 - 20:16 by sak2005 »

sak2005

  • Posts: 998
Tip: How to  Create F# Library ::)

The Module has 2 modules is MainModule and SubModule

In the module has Type is class , and has 2 classes is ClassForm and ClassLibrary

For this example codes , using module for call bass APIs and using class type for methods bass.

If created library dlls , must using namespace, if not then get error! open system fail.

SampleCode:
Code: [Select]
namespace FSharp.Library1 //Must using namespace.

open System
open System.Runtime.InteropServices

//Call bass APIs
module private BASS =
   [<DllImport("bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_Init")>]
     extern bool _Init(int device, int freq, int iflags, IntPtr win, IntPtr clsid)
   [<DllImport("bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_StreamCreateFile")>]
     extern int _StreamCreateFile(bool mem, string file, int64 offset, int64 length, int bflags)
   [<DllImport("bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_ChannelPlay")>]
     extern bool _ChannelPlay(int handle, bool restart)
   [<DllImport("bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_ChannelBytes2Seconds")>]
     extern double _ChannelBytes2Seconds(int handle, int64 lenpos)
   [<DllImport("bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_ChannelGetLength")>]
     extern int64 _ChannelGetLength(int handle, int mode)
   [<DllImport("bass.dll", CharSet=CharSet.Auto, EntryPoint="BASS_ChannelGetPosition")>]
     extern int64 _ChannelGetPosition(int handle, int mode)
   
//Bass class.
type public Bass() =     
     inherit Object()
       
     member this.BASS_Init(device:int, freq:int, iflags:int, win:IntPtr):bool=
            BASS._Init(device, freq, iflags, win, IntPtr.Zero) 
     member this.BASS_StreamCreateFile(file:string, offset:int64, length:int64, bflags:int):int=
            BASS._StreamCreateFile(false, file, offset, length, bflags ||| 0x80000000)
     member this.BASS_ChannelPlay(handle:int, restart:bool):bool=
            BASS._ChannelPlay(handle, restart)

Example:
Code: [Select]
// Console Application

open System
open FSharp.Library1 //References Dll.
     
let bass = new Bass() //Created Instance.

let bl = bass.BASS_Init(-1, 44100, 0, IntPtr.Zero)
let ch = bass.BASS_StreamCreateFile("sound.mp3", int64(0), int64(0), 0)
let pl = bass.BASS_ChannelPlay(ch, false)
let vk = Console.ReadKey()
« Last Edit: 9 Oct '17 - 17:35 by sak2005 »

sak2005

  • Posts: 998
Tip: F# EventHandler and other Events ::)

Example:
Code: [Select]
//Console Application
open System

//Event class
type ShowNumber(num : int) = class
     inherit EventArgs()
     let mutable _num = num
     let numChanged = new Event<unit>() //created event
     member this.NumChanged = numChanged.Publish //exposed event handler
     member this.Num
        with get() = _num //get OldNum
        and set(value) =
           _num <- value    //if set NewNum, will event
           numChanged.Trigger() //invokes event handler
end         

//Test
let p = new ShowNumber(0) //created new instance and set args value OldNum
printfn "-- Name changed! Old num: %i" p.Num //show old num
p.NumChanged.Add(fun () ->
printfn "-- Name changed! New name: %i" p.Num) //event for show new num
p.Num <- 100 //set new num
let vk = Console.ReadKey()
« Last Edit: 10 Oct '17 - 17:24 by sak2005 »

sak2005

  • Posts: 998
Tip : Properties F# and C#

Code: [Select]
//Console Application
open System

//properties class type
let mutable _num = 0
type Number1 =
 member this.Num with get()= _num
                  and set(value)= _num <- value

//method class type
type Number2(num : int)=
     let mutable _num = num
     member this.Num with get()= _num
                      and set(value)= _num <- value

Code: [Select]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    #region number class
    sealed class Number
    {
        private static int _num;
        public static int Num
        {
            get
            {
                return _num;
            }
            set
            {
                _num = value;
            }
        }

        public static int ShowNum(int num)
        {
            var n = Num = num;
            return n;
        }
    }
    #endregion
}
« Last Edit: 10 Oct '17 - 20:53 by sak2005 »

sak2005

  • Posts: 998
Tip: Method function F# and C#

Code: [Select]
//Console Application

//Test
 let n = new Number2(100) //set return value 
  let ShowNumber = //method function
      Console.WriteLine(n.Num)
      Console.ReadKey()

Code: [Select]
//Console Application
class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("old num: " + Number.ShowNum(0));
            int n = Number.Num = 100;
            Console.WriteLine("new num: " + Number.ShowNum(n));
            Console.ReadKey();
        }
    }

Note:
If ีusing type()= then is class
If using type = then is properties method
« Last Edit: 10 Oct '17 - 20:59 by sak2005 »

sak2005

  • Posts: 998
Tip F#: Sub method and Function method ???

Code: [Select]
let mymethod() = //this's sub method, no return

Code: [Select]
let mymethod() : int = //this's function method, had return

sak2005

  • Posts: 998
Tip: Created Sub new in the Class ::)

Example:
Code: [Select]
//f# console application
open System

//class
type MyType(name) =
    let mutable name = name
    do
        () // do some side effect
    member self.DoSomething() =
        ()
    member self.PropName
        with get() = name
        and set value =
            name <- value
   
    new() = new MyType("default name") //sub new

//Test
let mytype = new MyType("Hello")
Console.WriteLine(mytype.PropName)
let vk = Console.ReadKey()
« Last Edit: 10 Oct '17 - 23:34 by sak2005 »

sak2005

  • Posts: 998
Tip: F# Bass method , properties and events (Form Application)::)

namespace BassPlayer

open System
open System.Drowing
open System.Windows.Forms

type Form1() as this =
        inherit Form()
       //define controls here
       //define Bass APIs here
       //define Bass constructors here
       //define Bass properties here
       //define Bass methods here
       //define Bass events here
       //define Program startup here

---------------------------------------------------------------------------------

Download: F# WinForms - Visual Studio 2010 Clickhere
« Last Edit: 12 Oct '17 - 18:00 by sak2005 »

sak2005

  • Posts: 998
Some sample codes with methods Bass is.. Init , StreamCreateFile , ChannelPly and Setposition

Code: [Select]
[<DllImport("bass", CharSet=CharSet.Auto, EntryPoint="BASS_Init")>]
static extern bool _Init(int device, int freq, int iflags, IntPtr win, IntPtr clsid)

[<DllImport("bass", CharSet=CharSet.Auto, EntryPoint="BASS_StreamCreateFile")>]
static extern int _StreamCreateFile(bool mem, string file, int64 offset, int64 length, int bflags)

[<DllImport("bass", CharSet=CharSet.Auto)>]
static extern bool BASS_ChannelPlay(int handle, bool restart)

member this.BASS_Init(device: int, freq: int, iflags: int, win: IntPtr): bool =
            _Init(device, freq, iflags, win, IntPtr.Zero)

member this.BASS_StreamCreateFile(file: string, offset: int64, length: int64, bflags: int): int =
            _StreamCreateFile(false, file, offset, length, bflags ||| 0x80000000)

Code: [Select]
member this.SetPosition(pos: double): bool =
            BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, pos), 0)
« Last Edit: 12 Oct '17 - 23:13 by sak2005 »

sak2005

  • Posts: 998
Some sample codes with properties Bass is.. Duration , MaxPosition and CurrentPosition ::)

Code: [Select]
member this.Duration: double =
           BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetLength(chan, 0))
member this.MaxPosition: double =
           this.Duration
member form.CurrentPosition: double =
           BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan, 0))
member this.VuLeft: int =
           BASS_ChannelGetLevel(chan) &&& 65535
member this.VuRight: int =
           (BASS_ChannelGetLevel(chan)>>>16) &&& 65535
member this.CPU: string =
           BASS_GetCPU().ToString("#0.00")
« Last Edit: 12 Oct '17 - 23:18 by sak2005 »

sak2005

  • Posts: 998
Tip F#: Some code Bass Active Status and bool IsPlaying ::)

Code: [Select]
member this.Status = //return string 
   match BASS_ChannelIsActive(chan) with
       | 1 -> "Playing"
       | 2 -> "Stalled"
       | 3 -> "Pause"
       | _ -> "Stopped"
   
member this.IsPlaying = //return bool
   match BASS_ChannelIsActive(chan) with
       | 1 -> true
       | _ -> false
« Last Edit: 12 Oct '17 - 23:52 by sak2005 »

sak2005

  • Posts: 998
Tip F#: Learn more with some keyword is.. let and member ::)

If create function in Form or type class then using.. member

let is constructor operater variable, easy using with console app

for example : with codes that error and no error

Code: [Select]
type MainForm() as this =
let _chan = 0
member this.chan with get() = _chan
 //--------------------------------------------       
member this.Button1_Click(e)
this.chan = BASS_StreamCreateFile(file, ---) //error!, chan will return bool

type MainForm() as this =
let mutable _chan = 0

member this.chan with get() = _chan
//---------------------------------------------
member this.Button1_Click(e)
this.chan <-  BASS_StreamCreateFile(file, ---) //no error, chan will return int

Learn more: Microsoft Visual F# Programming Clickhere
« Last Edit: 13 Oct '17 - 09:01 by sak2005 »

sak2005

  • Posts: 998
Tip F#: How to shared or static Class ::)

Code: [Select]
namespace FSharp.BassLib

open System
open System.Drawing
open System.Windows.Forms
open System.Runtime.InteropServices

[<AbstractClass; Sealed>] //attribute class
type public Bass() =
     inherit Object()
     [<DllImport("bass", CharSet=CharSet.Auto, EntryPoint="BASS_PluginLoad")>]
     static extern int _PluginLoad(string file, int bflags)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern bool BASS_PluginFree(int bflags)
     [<DllImport("bass", CharSet=CharSet.Auto, EntryPoint="BASS_Init")>]
     static extern bool _Init(int device, int freq, int iflags, IntPtr win, IntPtr clsid)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern bool BASS_StreamFree(int handle)
     [<DllImport("bass", CharSet=CharSet.Auto, EntryPoint="BASS_StreamCreateFile")>]
     static extern int _StreamCreateFile(bool mem, string file, int64 offset, int64 length, int bflags)
     [<DllImport("bass", CharSet=CharSet.Auto, EntryPoint="BASS_ChannelPlay")>]
     static extern bool _ChannelPlay(int handle, bool restart)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern bool BASS_ChannelPause(int handle)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern bool BASS_ChannelStop(int handle)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern bool BASS_Free()
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern int BASS_ChannelIsActive(int handle)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern double BASS_ChannelBytes2Seconds(int handle, int64 lenpos)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern int64 BASS_ChannelGetLength(int handle, int mode)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern int64 BASS_ChannelGetPosition(int handle, int mode)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern int64 BASS_ChannelSeconds2Bytes(int handle, double pos)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern bool BASS_ChannelSetPosition(int handle, int64 pos)
     [<DllImport("bass", CharSet=CharSet.Auto)>]
     static extern int BASS_ChannelGetLevel(int handle)
     
     static let mutable _chan = 0
     static member chan with get() = _chan //operate return of StreamCreateFile
                         and set(v)= _chan <- v
     static member Duration with get()= BASS_ChannelBytes2Seconds(Bass.chan, BASS_ChannelGetLength(Bass.chan, 0))
     static member MaxPosition with get () = BASS_ChannelBytes2Seconds(Bass.chan, BASS_ChannelGetLength(Bass.chan, 0)) 
     static member CurrentPosition with get () =  BASS_ChannelBytes2Seconds(Bass.chan, BASS_ChannelGetPosition(Bass.chan, 0)) 
     static member BASS_PluginLoad(file: string, bflags: int): int =
      _PluginLoad(file, 0x80000000)
     static member BASS_Init(device: int, freq: int, iflags: int, win: IntPtr): bool =
      _Init(device, freq, iflags, win, IntPtr.Zero)
     static member BASS_StreamCreateFile(file: string, offset: int64, length: int64, bflags: int): int =
      _StreamCreateFile(false, file, offset, length, bflags ||| 0x80000000)
     static member BASS_ChannelPlay(handle: int, restart: bool): bool =   
      Bass.chan <- handle
      _ChannelPlay(Bass.chan, restart) 

Example: Test with Console App
Code: [Select]
namespace FSharp.Console1

open System
open System.Collections.Generic

open FSharp.BassLib

module MyConsole =
 
 let bl = Bass.BASS_Init(-1, 44100, 0, IntPtr.Zero)     
 Bass.chan <- Bass.BASS_StreamCreateFile("sound.mp3", int64(0), int64(0), 0)
 let pl = Bass.BASS_ChannelPlay(Bass.chan, false)
 Console.WriteLine("   Init: " + bl.ToString())
 Console.WriteLine(" Stream: " + Bass.chan.ToString())
 Console.WriteLine(" Length: " + Bass.Duration.ToString())
 Console.WriteLine("Playing: " + pl.ToString())
 let vk = Console.ReadKey()
« Last Edit: 13 Oct '17 - 19:29 by sak2005 »

sak2005

  • Posts: 998
Tip C#: Advance EventHandler, Using.. Event class and Thread ::)

Part1: Constructors
Code: [Select]
using System;
using System.Windows.Forms;
using System.Threading;
using Microsoft.VisualBasic;
using System.Runtime.InteropServices;
namespace BassLib
{
    public class BassClass : object
    {
        #region Bass APIs
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_PluginLoad")]
        private static extern int _PluginLoad(string file, int iflags);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_PluginFree")]
        private static extern bool _PluginFree(int fhandle);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_Init")]
        private static extern bool _Init(int device, int freq, int iflags, IntPtr win, IntPtr clsid);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_StreamFree")]
        private static extern bool _StreamFree(int handle);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_StreamCreateFile")]
        private static extern int _StreamCreateFile(bool mem, string file, long offset, long length, int bflags);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelPlay")]
        private static extern bool _ChannelPlay(int handle, bool restart);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelPause")]
        private static extern bool _ChannelPause(int handle);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelStop")]
        private static extern bool _ChannelStop(int handle);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_Free")]
        private static extern bool _Free();
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelIsActive")]
        private static extern int _ChannelIsActive(int handle);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelBytes2Seconds")]
        private static extern double _ChannelBytes2Seconds(int handle, long lenpos);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelGetLength")]
        private static extern long _ChannelGetLength(int handle, int mode);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelGetPosition")]
        private static extern long _ChannelGetPosition(int handle, int mode);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelSeconds2Bytes")]
        private static extern long _ChannelSeconds2Bytes(int handle, double pos);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelSetPosition")]
        private static extern bool _ChannelSetPosition(int handle, long pos, int mode);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_ChannelGetLevel")]
        private static extern int _ChannelGetLevel(int handle);
        [DllImport("bass", CharSet = CharSet.Auto, EntryPoint = "BASS_GetCPU")]
        private static extern float _GetCPU();
        #endregion
       
        #region Bass Constructors
        private Thread thread = null;
        private static double _pos;
        private static int sflag;
        private static int _strm;
       
        public BassClass() : base()
        {
            Control.CheckForIllegalCrossThreadCalls = false;
            this.thread = new Thread(new ThreadStart(OnPositionChanged));
            this.thread.IsBackground = true;
            this.thread.Priority = ThreadPriority.Lowest;
            this.thread.Start();
            BassClass._strm = 0;
            BassClass.sflag = 0;
            BassClass._pos = (double)0;
        }
        #endregion
        ~BassClass()
        {
            if(this.strm!=0)
            this.BASS_Free();
        }

sak2005

  • Posts: 998
Part2: Methods and Properties
Code: [Select]
#region Bass methods
        public int BASS_PluginLoad(string file)
        {
            return BassClass._PluginLoad(file, -2147483648);
        }
        public bool BASS_PluginFree(int fhandle)
        {
            return BassClass._PluginFree(fhandle);
        }
        public bool BASS_Init(int device, int freq, int iflags, IntPtr win)
        {
             return BassClass._Init(device, freq, iflags, win, IntPtr.Zero);
        }
        public bool BASS_StreamFree(int handle)
        {
            var bl = false;
            if (handle != 0)
            {
                bl = BassClass._StreamFree(this.strm);
            }
            return bl;
        }
        public int BASS_StreamCreateFile(string file, long offset, long length, int bflags)
        {
           BassClass.sflag = bflags;
            var result = 0;
            this.strm = BassClass._StreamCreateFile(false, file, offset, length, sflag | -2147483648);
            if (this.strm != 0)
            {result = this.strm;}
            else{Interaction.MsgBox("Error! file not support.");}
            return result;
        }
        public bool BASS_ChannelPlay(int handle, bool restart)
        {
            var bl = false;
            if (handle != 0)
            {
               
                bl = BassClass._ChannelPlay(this.strm, restart);
            }
            return bl;
        }
        public bool BASS_ChannelPause(int handle)
        {
            var bl = false;
            if (handle != 0)
            {
                bl = BassClass._ChannelPause(this.strm);
            }
            return bl;
        }
        public bool BASS_ChannelStop(int handle)
        {
            var bl = false;
            if (handle != 0)
            {
                this.SetPosition((double)0);
                bl = BassClass._ChannelStop(this.strm);
            }
            return bl;
        }
        public bool BASS_Free()
        {
            var bl = false;
            if (this.strm != 0)
            {
                bl = BassClass._Free();
            }
            return bl;
        }
        public int BASS_ChannelIsActive(int handle)
        {
            var res = 0;
            if (handle != 0)
            {
                res = BassClass._ChannelIsActive(this.strm);
            }
            return res;
        }
        public double BASS_ChannelBytes2Seconds(int handle, long lenpos)
        {
            var result = (double)0;
            if (handle != 0)
            {
               result = BassClass._ChannelBytes2Seconds(this.strm, lenpos);
            }
            return result;
        }
        public long BASS_ChannelGetLength(int handle)
        {
            var result = (long)0;
            if (handle != 0)
            {
                result = BassClass._ChannelGetLength(this.strm, 0);
            }
            return result;
        }
        public long BASS_ChannelGetPosition(int handle)
        {
            var result = (long)0;
            if (handle != 0)
            {
                result = BassClass._ChannelGetPosition(this.strm, 0);
            }
            return result;
        }
        public long BASS_ChannelSeconds2Bytes(int handle, double pos)
        {
            var result = (long)0;
            if (handle != 0)
            {
                result = BassClass._ChannelSeconds2Bytes(this.strm, pos);
            }
            return result;
        }
        public bool BASS_ChannelSetPosition(int handle, long pos, int mode)
        {
            var result = false;
            if (handle != 0)
            {
                return BassClass._ChannelSetPosition(this.strm, pos, mode);
            }
            return result;
        }
        public int BASS_ChannelGetLevel(int handle)
        {
            var result = 0;
            if (handle != 0)
            {
                result = BassClass._ChannelGetLevel(this.strm);
            }
            return result;
        }
        public float BASS_GetCPU()
        {
            var result = (float)0;
            if (this.strm != 0)
            {
                result = BassClass._GetCPU();
            }
            return result;
        }
        public bool SetPosition(double pos)
        {
            return BASS_ChannelSetPosition(this.strm, BASS_ChannelSeconds2Bytes(this.strm, pos), 0);
        }
        #endregion
       
        #region Bass Properties
        private double pos
        {
            get
            {
                return BassClass._pos;
            }
            set
            {
                BassClass._pos = value;
            }
        }
        private int strm
        {
            get
            {
                return BassClass._strm;
            }
            set
            {
                BassClass._strm = value;
            }
        }
        public double Duration
        {
            get
            {
                return this.BASS_ChannelBytes2Seconds(this.strm, BASS_ChannelGetLength(this.strm));
            }
        }
        public double MaxPosition
        {
            get
            {
                return this.Duration;
            }
        }
        public double CurrentPosition
        {
            get
            {
                 return this.BASS_ChannelBytes2Seconds(this.strm, BASS_ChannelGetPosition(this.strm));
            }
        }
        public bool IsPlaying
        {
            get
            {
                if (this.BASS_ChannelIsActive(this.strm) == 1)
                {
                    return true;
                }
                return false;
            }
        }
        public string Status
        {
            get
            {
                var str = "";
                switch(this.BASS_ChannelIsActive(this.strm))
                {
                    case 1:
                        str = "Playing";
                        break;
                    case 2:
                        str = "Stalled";
                        break;
                    case 3:
                        str = "Paused";
                        break;
                    default:
                        str = "Stopped";
                        break;
                }
                return str;
            }
        }
        public string CPU
        {
            get
            {
                return this.BASS_GetCPU().ToString("#0.00");
            }
        }
        public int VuLeft
        {
            get
            {
                var res = 0;
                if (IsPlaying)
                {
                    res = this.BASS_ChannelGetLevel(this.strm) & 65535;
                }
                else
                {
                    return 0;
                }
                return res;
            }
        }
        public int VuRight
        {
            get
            {
                var res = 0;
                if (IsPlaying)
                {
                    res = (this.BASS_ChannelGetLevel(this.strm)>>16) & 65535;
                }
                else
                {
                    return 0;
                }
                return res;
            }
        }
        #endregion
« Last Edit: 18 Oct '17 - 09:36 by sak2005 »

sak2005

  • Posts: 998
Part3: On Event
Code: [Select]
private void OnPositionChanged()
        {
           lio:
            do
            {
              if (this.CurrentPosition < this.Duration)
               {
                   this.pos = this.CurrentPosition;
                   PositionChanged(new PositionChangedEventArgs(this.pos));
               }
               else
               {
                   if (BassClass.sflag == 4)
                   {
                       this.SetPosition((double)0);
                       goto lio;
                   } 
                   this.BASS_ChannelStop(this.strm);
               }
               Thread.Sleep(50);
               Application.DoEvents();
            } while(true);
        }
        public event PositionChangedEventHandler PositionChanged;
} //end class
« Last Edit: 19 Oct '17 - 07:19 by sak2005 »

sak2005

  • Posts: 998
Event class:
Code: [Select]
public class PositionChangedEventArgs : EventArgs
    {
        private double _pos = (double)0;
        public PositionChangedEventArgs(double pos) : base()
        {
            _pos = pos;
        }
        public double CurrentPos
        {
            get
            {
                try
                {
                    return _pos;
                }
                catch
                {
                    return (double)0;
                }
            }
        }
    }
    public delegate void PositionChangedEventHandler(PositionChangedEventArgs e);
} // end namespace
« Last Edit: 19 Oct '17 - 07:20 by sak2005 »

sak2005

  • Posts: 998
Example: BassPlayer Form Application
Code: [Select]
using System;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Windows.Forms;
using BassLib;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        private BassClass Bass = new BassClass();
        private int chan;
        public Form1()
        {
            InitializeComponent();
            Bass.PositionChanged +=new PositionChangedEventHandler(Bass_PositionChanged);
            this.chan = 0;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Bass.BASS_Init(-1,44100,0,this.Handle);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (chan != 0) { Bass.BASS_StreamFree(chan); }
                chan = Bass.BASS_StreamCreateFile(openFileDialog1.FileName, 0, 0, 0 | 4 );
                label3.Text = TimeSpan.FromSeconds(Bass.Duration).ToString().Substring(0, 8);
                trackBar1.Maximum = (int)Bass.MaxPosition;
                button2_Click(sender, e);
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Bass.BASS_ChannelPlay(chan, false);
        }
        private void Bass_PositionChanged(PositionChangedEventArgs e)
        {
            label1.Text = TimeSpan.FromSeconds(e.CurrentPos).ToString().Substring(0, 8);
            trackBar1.Value = (int)e.CurrentPos;
            label2.Text = Bass.Status;
            label4.Text = Bass.CPU;
            progressBar1.Value = Bass.VuLeft;
            progressBar2.Value = Bass.VuRight;
        }

        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            Bass.SetPosition((double) trackBar1.Value);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Bass.BASS_ChannelPause(chan);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Bass.BASS_ChannelStop(chan);
        }
    }
}

sak2005

  • Posts: 998
BOO programming with Creatting BassLib Class ::)

Code: [Select]
#BassClass.boo
namespace BassLib

import System
import System.Threading
import System.Windows.Forms
import System.Runtime.InteropServices

class Bass(object):
   #region constructors
   private thread as Thread
   private chan as int
   private duration as double
   private maxPosition as double
   private currentposition as double
   private pos as double
   private sflag as int
   #region delegate event handler
   public callable PositionChangedEventHandler(e as BassLib.PositionChangedEventArgs)as void
   public event PositionChanged as PositionChangedEventHandler
   #endregion
   public def constructor():
     Control.CheckForIllegalCrossThreadCalls = false
     self.thread = Thread(ThreadStart(OnPositionChanged))
     self.chan = 0
     self.duration = 0.0
     self.maxPosition = 0.0
     self.currentposition = 0.0
     self.pos = 0.0
     self.sflag = 0
     self.thread.IsBackground = true
     self.thread.Priority = ThreadPriority.Lowest
     self.thread.Start()
   #endregion
   #region APIs
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_PluginLoad")]
   private static def _PluginLoad(file as String, bflags as int)as int :
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_PluginFree")]
   private static def _PluginFree(fhandle as int)as bool :
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_Init")]
   private static def _Init(device as int, freq as int, iflags as int, win as System.IntPtr, clsid as System.IntPtr)as bool:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_StreamFree")]
   private static def _StreamFree(handle as int)as bool :
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_StreamCreateFile")]
   private static def _StreamCreateFile(mem as bool, file as string, offset as long, length as long, bflags as int)as int:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelPlay")]
   private static def _ChannelPlay(handle as int, restart as bool)as bool :
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelPause")]
   private static def _ChannelPause(handle as int)as bool:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelStop")]
   private static def _ChannelStop(handle as int)as bool:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_Free")]
   private static def _Free()as bool:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelIsActive")]
   private static def _ChannelIsActive(handle as int)as int:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelBytes2Seconds")]
   private static def _ChannelBytes2Seconds(handle as int, lenpos as long)as double:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelGetLength")]
   private static def _ChannelGetLength(handle as int, mode as int)as long:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelGetPosition")]
   private static def _ChannelGetPosition(handle as int, mode as int)as long:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelSeconds2Bytes")]
   private static def _ChannelSeconds2Bytes(handle as int, pos as double)as long:
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelSetPosition")]
   private static def _ChannelSetPosition(handle as int, pos as long, mode as int)as bool:
      pass   
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_GetCPU")]
   private static def _GetCPU()as single :
      pass
   [DllImport("bass.dll", CharSet:CharSet.Auto, EntryPoint:"BASS_ChannelGetLevel")]
   private static def _ChannelGetLevel(handle as int)as int:
      pass
   #endregion
   #region methods
   def BASS_PluginLoad(file as String)as int:
       try:
          return Bass._PluginLoad(file, -2147483648L)
       except e:
          return 0
   def BASS_PluginFree(fhandle as int)as bool:
       try:
          return Bass._PluginFree(fhandle)
       except e:
          return false
   def BASS_Init(device as int, freq as int, iflags as int, win as System.IntPtr)as bool:
       try:
          return Bass._Init(device, freq, iflags, win, IntPtr.Zero)
       except e:
          return false
   def BASS_StreamFree(handle as int)as bool:
       try:
          return Bass._StreamFree(self.chan)
       except e:
          return false
   def BASS_StreamCreateFile(file as string, offset as long, length as long, bflags as int)as int:
       sflag = bflags
       try:
          self.chan = Bass._StreamCreateFile(false, file, offset, length, bflags | -2147483648L)
          return self.chan
       except e:
          return 0
   def BASS_ChannelPlay(handle as int, restart as bool)as bool:
       try:
          return Bass._ChannelPlay(self.chan , restart)
       except e:
          return false
   def BASS_ChannelPause(handle as int)as bool:
       try:
          return Bass._ChannelPause(self.chan)
       except e:
          return false
   def BASS_ChannelStop(handle as int)as bool:
       try:
          self.SetPosition(0.0)
          return Bass._ChannelStop(self.chan)
       except e:
          return false
   def BASS_ChannelIsActive(handle as int)as int:
       try:
          return Bass._ChannelIsActive(self.chan)
       except e:
          return 0
   def SetPosition(pos as double)as bool:
       try:
          return Bass._ChannelSetPosition(self.chan, Bass._ChannelSeconds2Bytes(self.chan, pos), 0)
       except e:
          return false
   def BASS_Free()as bool :
       try:
          return Bass._Free()
       except e:
          return false
   #endregion
   #region properties
   Duration as double:
     get:
       try:
         self.duration = Bass._ChannelBytes2Seconds(self.chan, Bass._ChannelGetLength(self.chan, 0))
         return self.duration
       except:
         return 0.0
   MaxPosition as double:
     get:
       try: 
         return self.Duration
       except e:
        return 0.0
   CurrentPosition as double:
     get:
       try:   
         self.currentposition = Bass._ChannelBytes2Seconds(self.chan, Bass._ChannelGetPosition(self.chan, 0))
         return self.currentposition
       except e:
      return 0.0
   IsPlaing as bool:
     get:
       try:
         if(self.BASS_ChannelIsActive(self.chan)==1):
            return true
         else:
            return false
       except e:
            return false
   CPU as string:
     get:
       try:   
         return Bass._GetCPU().ToString("#0.00")
       except e:
        return '0.00'
   VuLeft as int:
     get:
        if(self.IsPlaing):
          try:
            return Bass._ChannelGetLevel(self.chan)& 65535
          except e:
          return 0 
        else:
           return 0
   VuRight as int:
     get:
        if(self.IsPlaing):
          try:   
            return (Bass._ChannelGetLevel(self.chan)>>16)& 65535
          except e:
          return 0
        else:
           return 0
   Status as string:
     get:
       try: 
         if self.BASS_ChannelIsActive(self.chan)==1:
            return "Playing"
         elif self.BASS_ChannelIsActive(self.chan)==2:             
            return "Stalled"
         elif self.BASS_ChannelIsActive(self.chan)==3:             
            return "Paused"
         else:
            return "Stopped"
       except e:
            return 'Error!'
   #endregion
   #region on event handler
   private def OnPositionChanged()as void:
     try:
       while true:
         :LIN
         if (self.CurrentPosition < self.Duration):
             self.PositionChanged(BassLib.PositionChangedEventArgs(self.currentposition))
         else :
            if(self.sflag != 4):
               self.BASS_ChannelStop(chan)
               Thread.Sleep(50)
               Application.DoEvents()
            else:
               self.SetPosition(0.0)
               goto LIN
     except e:
      return
   #endregion
   
#region eventargs class
class PositionChangedEventArgs(EventArgs):
  private _pos as double
  public def constructor(pos as double):
    self._pos = pos
   CurrentPos as double:
    get:
     try:
      return self._pos
     except e:
      return 0.0
#endregion
« Last Edit: 24 Oct '17 - 03:41 by sak2005 »

sak2005

  • Posts: 998
Example: BOO MainForm Designer ::)

Code: [Select]
#MainForm.Designer.boo
namespace BooBassPlayerFormApplication

import System
import System.ComponentModel
import System.Windows.Forms

partial class MainForm(Form):
   
   private components as IContainer = null
   private lblDuration as System.Windows.Forms.Label = null
   private lblPosition as System.Windows.Forms.Label = null
   private lblStatus as System.Windows.Forms.Label = null
   private lblCpu as System.Windows.Forms.Label = null
   private btnLoad as System.Windows.Forms.Button = null
   private btnPlay as System.Windows.Forms.Button = null
   private btnPause as System.Windows.Forms.Button = null
   private btnStop as System.Windows.Forms.Button = null
   private trackPos as System.Windows.Forms.TrackBar = null
   private pBarL as System.Windows.Forms.ProgressBar = null
   private pBarR as System.Windows.Forms.ProgressBar = null
   
   protected override def Dispose(disposing as bool) as void:
    try:
     if disposing:
     if components is not null:
           components.Dispose()
     super(disposing)
    except e:
       return
   
   private def InitializeComponent()as void:
//Label1
   self.lblPosition = System.Windows.Forms.Label()
   self.lblPosition.Text = "00:00:00"
   self.lblPosition.Location = System.Drawing.Point(4, 0)
   self.Controls.Add(lblPosition)
   //Label2
   self.lblStatus = System.Windows.Forms.Label()
   self.lblStatus.Text = "Stopped"
   self.lblStatus.Location = System.Drawing.Point(120, 0)
   self.Controls.Add(lblStatus)
   //Label3
   self.lblDuration = System.Windows.Forms.Label()
   self.lblDuration.Text = "00:00:00"
   self.lblDuration.Location = System.Drawing.Point(248, 0)
   self.Controls.Add(lblDuration)
   //Label4
   self.lblCpu = System.Windows.Forms.Label()
   self.lblCpu.Text = "0.00"
   self.lblCpu.Location = System.Drawing.Point(130, 60)
   self.Controls.Add(lblCpu)
   //Button1
   self.btnLoad = System.Windows.Forms.Button()
   self.btnLoad.Text = 'Load'
   self.btnLoad.Cursor = Cursors.Hand
   self.btnLoad.Size = System.Drawing.Size(60, 23)
   self.btnLoad.Location = System.Drawing.Point(5, 105)
   self.btnLoad.Click += System.EventHandler(btnLoad_Click)
   self.Controls.Add(btnLoad)
   //Button2
   self.btnPlay = System.Windows.Forms.Button()
   self.btnPlay.Text = 'Play'
   self.btnPlay.Cursor = Cursors.Hand
   self.btnPlay.Size = System.Drawing.Size(60, 23)
   self.btnPlay.Location = System.Drawing.Point(80, 105)
   self.btnPlay.Click += System.EventHandler(btnPlay_Click)
   self.Controls.Add(btnPlay)
   //Button3
   self.btnPause = System.Windows.Forms.Button()
   self.btnPause.Text = 'Pause'
   self.btnPause.Cursor = Cursors.Hand
   self.btnPause.Size = System.Drawing.Size(60, 23)
   self.btnPause.Location = System.Drawing.Point(160, 105)
   self.btnPause.Click += System.EventHandler(btnPause_Click)
   self.Controls.Add(btnPause)
   //Button4
   self.btnStop = System.Windows.Forms.Button()
   self.btnStop.Text = 'Stop'
   self.btnStop.Cursor = Cursors.Hand
   self.btnStop.Size = System.Drawing.Size(60, 23)
   self.btnStop.Location = System.Drawing.Point(235, 105)
   self.btnStop.Click += System.EventHandler(btnStop_Click)
   self.Controls.Add(btnStop)
   //TrackBer1
   self.trackPos = System.Windows.Forms.TrackBar()
   self.trackPos.Size = System.Drawing.Size(300, 20)
   self.trackPos.Location = System.Drawing.Point(0, 20)
   self.trackPos.Scroll += System.EventHandler(trackPos_Scroll)
   self.Controls.Add(trackPos)
   //ProgreaaBar1
   self.pBarL = System.Windows.Forms.ProgressBar()
   self.pBarL.Maximum = 32768
   self.pBarL.RightToLeft = System.Windows.Forms.RightToLeft.Yes
   self.pBarL.RightToLeftLayout = true
   self.pBarL.Size = System.Drawing.Size(145, 12)
   self.pBarL.Location = System.Drawing.Point(5, 85)
   self.Controls.Add(pBarL)
   //ProgressBar2
   self.pBarR = System.Windows.Forms.ProgressBar()
   self.pBarR.Maximum = 32768
   self.pBarR.Size = System.Drawing.Size(145, 12)
   self.pBarR.Location = System.Drawing.Point(150, 85)
   self.Controls.Add(pBarR)
   // Form1
   self.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
   self.Text = 'BOO Bass Player'
   self.Name = 'MainForm'
   self.ClientSize = System.Drawing.Size(300, 135)
   self.MaximizeBox = false
   self.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink
   self.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
   self.Load += System.EventHandler(self_Load)
   self.FormClosing += System.Windows.Forms.FormClosingEventHandler(self_Closing)
   self.ResumeLayout(false)

Code: [Select]
#MainForm.boo
namespace BooBassPlayerFormApplication

import System
import System.Windows.Forms
import BassLib

partial class MainForm(Form):
   
   public ofd as OpenFileDialog = null
   public Bass as Bass = null
   public fplug as int
   public chan as int
 
   public def constructor():
      self.ofd = System.Windows.Forms.OpenFileDialog()
      self.ofd.Filter = "Media Files|*.*"
      self.Bass = BassLib.Bass()
      self.fplug = 0
      self.chan = 0
      self.Bass.PositionChanged += BassLib.Bass.PositionChangedEventHandler(Bass_PositionChanged)
     
      InitializeComponent()
             
   private def self_Load(sender as object, e as System.EventArgs)as void:
      self.Bass.BASS_Init(-1, 44100, 0, self.Handle)
      self.Bass.BASS_PluginLoad("bass_aac.dll")
   
   private def btnLoad_Click(sender as object, e as System.EventArgs)as void:
     try:   
       if(self.ofd.ShowDialog()== DialogResult.OK):
          if(self.chan != 0): self.Bass.BASS_StreamFree(self.chan)
          self.chan = self.Bass.BASS_StreamCreateFile(self.ofd.FileName, 0, 0, 0 | 4)
         if(self.chan != 0):
            self.Text = System.IO.Path.GetFileName(self.ofd.FileName)
            self.lblDuration.Text = TimeSpan.FromSeconds(self.Bass.Duration).ToString().Substring(0, 8)
            self.trackPos.Maximum = Convert.ToInt32(self.Bass.MaxPosition)
            btnPlay_Click(sender, e)
         else:
        MessageBox.Show("Error! file not support.")
       else:
      return
     except e:
      return
   private def btnPlay_Click(sender as object, e as System.EventArgs)as void:
     try:         
       self.Bass.BASS_ChannelPlay(self.chan, false)
     except e:
       return
   private def btnPause_Click(sender as object, e as System.EventArgs)as void:
     try:     
       self.Bass.BASS_ChannelPause(self.chan)
     except e:
       return
   private def btnStop_Click(sender as object, e as System.EventArgs)as void:
     try:     
       self.Bass.BASS_ChannelStop(self.chan)
     except e:
       return
   private def trackPos_Scroll(sender as object, e as System.EventArgs)as void:
     try:     
       self.Bass.SetPosition(Convert.ToDouble(self.trackPos.Value))
     except e:
       return
   private def Bass_PositionChanged(e as BassLib.PositionChangedEventArgs)as void:
     try:     
       self.trackPos.Value = Convert.ToInt32(e.CurrentPos)
       self.lblPosition.Text = TimeSpan.FromSeconds(e.CurrentPos).ToString().Substring(0, 8)
       self.lblStatus.Text = self.Bass.Status
       self.lblCpu.Text = self.Bass.CPU
       self.pBarL.Value = self.Bass.VuLeft
       self.pBarR.Value = self.Bass.VuRight
     except e:
       return
   private def self_Closing(sender as Object, e as FormClosingEventArgs)as void:
     try:      
       self.Bass.BASS_PluginFree(fplug)
       self.Bass.BASS_Free()
     except e:
       return
#startup
[STAThread]
public def Main(argv as (string)) as void:
  Application.EnableVisualStyles()
  Application.SetCompatibleTextRenderingDefault(false)
  Application.Run(MainForm())

SharpDevelop Program Editor: Clickhere
Learn more: Boo Language Programming Clickhere
YouTube Sak2005 Programmer: Clickhere
« Last Edit: 24 Oct '17 - 04:05 by sak2005 »