static void Main() { PlatformInit(); ServiceStack.Licensing.RegisterLicense(@"1001-e1JlZjoxMDAxLE5hbWU6VGVzdCBCdXNpbmVzcyxUeXBlOkJ1c2luZXNzLEhhc2g6UHVNTVRPclhvT2ZIbjQ5MG5LZE1mUTd5RUMzQnBucTFEbTE3TDczVEF4QUNMT1FhNXJMOWkzVjFGL2ZkVTE3Q2pDNENqTkQyUktRWmhvUVBhYTBiekJGUUZ3ZE5aZHFDYm9hL3lydGlwUHI5K1JsaTBYbzNsUC85cjVJNHE5QVhldDN6QkE4aTlvdldrdTgyTk1relY2eis2dFFqTThYN2lmc0JveHgycFdjPSxFeHBpcnk6MjAxMy0wMS0wMX0="); if (Environment.GetCommandLineArgs().Length > 1) { string arg = Environment.GetCommandLineArgs()[1]; string paramName = "Language="; if (arg.StartsWith(paramName)) { arg = arg.Substring(paramName.Length); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(arg); } } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); try { using (Ares.Playing.BassInit bassInit = new Ares.Playing.BassInit(-1, s => MessageBox.Show(s, StringResources.Ares, MessageBoxButtons.OK, MessageBoxIcon.Warning))) { Application.Run(new Player(bassInit)); } } #if !MONO catch (Ares.Ipc.ApplicationAlreadyStartedException) { } #endif catch (Ares.Playing.BassInitException ex) { MessageBox.Show(ex.Message, StringResources.Ares, MessageBoxButtons.OK, MessageBoxIcon.Stop); } }
static int Main(string[] args) { System.AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); ServiceStack.Licensing.RegisterLicense(@"1001-e1JlZjoxMDAxLE5hbWU6VGVzdCBCdXNpbmVzcyxUeXBlOkJ1c2luZXNzLEhhc2g6UHVNTVRPclhvT2ZIbjQ5MG5LZE1mUTd5RUMzQnBucTFEbTE3TDczVEF4QUNMT1FhNXJMOWkzVjFGL2ZkVTE3Q2pDNENqTkQyUktRWmhvUVBhYTBiekJGUUZ3ZE5aZHFDYm9hL3lydGlwUHI5K1JsaTBYbzNsUC85cjVJNHE5QVhldDN6QkE4aTlvdldrdTgyTk1relY2eis2dFFqTThYN2lmc0JveHgycFdjPSxFeHBpcnk6MjAxMy0wMS0wMX0="); if (Environment.GetCommandLineArgs().Length > 1) { string arg = Environment.GetCommandLineArgs()[1]; string paramName = "Language="; if (arg.StartsWith(paramName)) { arg = arg.Substring(paramName.Length); System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(arg); } } Console.WriteLine(String.Format(StringResources.AresPlayer, (new System.Reflection.AssemblyName(System.Reflection.Assembly.GetExecutingAssembly().FullName)).Version.ToString())); Console.WriteLine(); int res = 0; try { PlayerOptions options = new PlayerOptions(); if (options.Parse(args)) { int outputDevice = options.OutputDevice == 0 ? -1 : options.OutputDevice; using (Ares.Playing.BassInit bassInit = new Ares.Playing.BassInit(outputDevice, s => Console.WriteLine(s))) { { Player player = new Player(bassInit); res = player.Run(options); } } } else { res = 2; } } catch (Ares.Playing.BassInitException ex) { Console.WriteLine(ex.Message); res = 1; } return(res); }
public Player(Ares.Playing.BassInit init) { m_PlayingControl = new PlayingControl(); m_BassInit = init; }