示例#1
0
        private static void ClearClipboardString()
        {
#if FAMISTUDIO_WINDOWS
            WinUtils.ClearClipboardString();
#elif FAMISTUDIO_MACOS
            MacUtils.ClearPasteboardString();
#endif
        }
示例#2
0
        private static string GetClipboardString()
        {
#if FAMISTUDIO_WINDOWS
            return(WinUtils.GetClipboardString());
#elif FAMISTUDIO_MACOS
            return(MacUtils.GetPasteboardString());
#else
            return(null);
#endif
        }
示例#3
0
        static byte[] linuxClipboardData; // Cant copy between FamiStudio instance on Linux.
#endif

        private static void SetClipboardDataInternal(byte[] data)
        {
#if FAMISTUDIO_WINDOWS
            WinUtils.SetClipboardData(data);
#elif FAMISTUDIO_MACOS
            MacUtils.SetPasteboardData(data);
#else
            linuxClipboardData = data;
#endif
        }
示例#4
0
        private static byte[] GetClipboardDataInternal(uint magic, int maxSize = int.MaxValue)
        {
            byte[] buffer = null;
#if FAMISTUDIO_WINDOWS
            buffer = WinUtils.GetClipboardData(maxSize);
#elif FAMISTUDIO_MACOS
            buffer = MacUtils.GetPasteboardData();
#else
            buffer = linuxClipboardData;
#endif

            if (buffer == null || BitConverter.ToUInt32(buffer, 0) != magic)
            {
                return(null);
            }

            return(buffer);
        }
示例#5
0
        static unsafe void Main(string[] args)
        {
#if FAMISTUDIO_WINDOWS
            try
            {
                // This is only supported in Windows 8.1+.
                SetProcessDpiAwareness(1 /*Process_System_DPI_Aware*/);
            }
            catch { }
#endif

            Settings.Load();
            RenderTheme.Initialize();
            PlatformUtils.Initialize();
            Cursors.Initialize();
            FamiStudioTempoUtils.Initialize();
            NesApu.InitializeNoteTables();

#if FAMISTUDIO_WINDOWS
            WinUtils.Initialize();
            PerformanceCounter.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#endif
#if FAMISTUDIO_LINUX
            LinuxUtils.SetProcessName("FamiStudio");
#endif

            var cli = new CommandLineInterface(args);

            if (!cli.Run())
            {
                var famiStudio = new FamiStudio(args.Length > 0 ? args[0] : null);
                famiStudio.Run();
            }

            Settings.Save();

#if FAMISTUDIO_LINUX
            // We sometimes gets stuck here on Linux, lets abort.
            Environment.Exit(0);
#endif
        }
示例#6
0
        static unsafe void Main(string[] args)
        {
#if FAMISTUDIO_WINDOWS
            try
            {
                // This is only supported in Windows 8.1+.
                SetProcessDpiAwareness(1 /*Process_System_DPI_Aware*/);
            }
            catch { }

            if (!PlatformUtils.IsVS2015RuntimeInstalled())
            {
                if (MessageBox.Show("You seem to be missing the VS 2015 C++ Runtime which is required to run FamiStudio, would you like to visit the FamiStudio website for instruction on how to install it?", "Missing Component", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Utils.OpenUrl("https://famistudio.org/doc/#windows");
                }

                return;
            }

            if (!XAudio2Stream.TryDetectXAudio2())
            {
                if (MessageBox.Show("You seem to be missing parts of DirectX which is required to run FamiStudio, would you like to visit the FamiStudio website for instruction on how to install it?", "Missing Component", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    Utils.OpenUrl("https://famistudio.org/doc/#windows");
                }

                return;
            }
#endif

            Settings.Load();
            RenderTheme.Initialize();
            PlatformUtils.Initialize();
#if !FAMISTUDIO_MACOS
            Cursors.Initialize();
#endif
            FamiStudioTempoUtils.Initialize();
            NesApu.InitializeNoteTables();

#if FAMISTUDIO_WINDOWS
            WinUtils.Initialize();
            PerformanceCounter.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#endif
#if FAMISTUDIO_LINUX
            LinuxUtils.SetProcessName("FamiStudio");
#endif

            var cli = new CommandLineInterface(args);

            if (!cli.Run())
            {
                var famiStudio = new FamiStudio(args.Length > 0 ? args[0] : null);
                famiStudio.Run();
            }

            Settings.Save();

#if FAMISTUDIO_LINUX
            // We sometimes gets stuck here on Linux, lets abort.
            Environment.Exit(0);
#endif
        }
示例#7
0
 public static void ClearClipboardString()
 {
     WinUtils.ClearClipboardString();
 }
示例#8
0
 public static string GetClipboardString()
 {
     return(WinUtils.GetClipboardString());
 }
示例#9
0
 public static byte[] GetClipboardData(int maxSize)
 {
     return(WinUtils.GetClipboardData(maxSize));
 }
示例#10
0
 public static void SetClipboardData(byte[] data)
 {
     WinUtils.SetClipboardData(data);
 }
示例#11
0
        static unsafe void Main(string[] args)
        {
#if FAMISTUDIO_WINDOWS
            try
            {
                // This is only supported in Windows 8.1+.
                SetProcessDpiAwareness(1 /*Process_System_DPI_Aware*/);
            }
            catch { }

            if (!PlatformUtils.IsVS2015RuntimeInstalled())
            {
                // MATTT : Update this message + link to 2019 runtime!
                if (MessageBox.Show("You seem to be missing the VS 2019 C++ Runtime which is required to run FamiStudio, would you like to visit the FamiStudio website for instruction on how to install it?", "Missing Component", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    PlatformUtils.OpenUrl("https://famistudio.org/doc/install/#windows");
                }

                return;
            }

            if (!XAudio2Stream.TryDetectXAudio2())
            {
                if (MessageBox.Show("You seem to be missing parts of DirectX which is required to run FamiStudio, would you like to visit the FamiStudio website for instruction on how to install it?", "Missing Component", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    PlatformUtils.OpenUrl("https://famistudio.org/doc/install/#windows");
                }

                return;
            }
#endif

            Init.InitializeBaseSystems();

#if FAMISTUDIO_WINDOWS
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
#if !DEBUG
            if (Settings.IsPortableMode)
            {
                WinUtils.AssociateExtension(".fms", Assembly.GetExecutingAssembly().Location, "FamiStudio Project", "FamiStudio Project");
            }
#endif
#elif FAMISTUDIO_LINUX
            LinuxUtils.SetProcessName("FamiStudio");
#endif

            var cli = new CommandLineInterface(args);

            if (!cli.Run())
            {
                var famiStudio = new FamiStudio();
                famiStudio.Initialize(args.Length > 0 ? args[0] : null);
                famiStudio.Run();
            }

            Settings.Save();

#if FAMISTUDIO_LINUX
            // We sometimes gets stuck here on Linux, lets abort.
            Environment.Exit(0);
#endif
        }