Exemple #1
0
        static void Main()
        {
            string mutexName = Properties.Settings.Default.Title;
            bool   createdNew;

            System.Threading.Mutex mutex = new System.Threading.Mutex(true, mutexName, out createdNew);
            if (createdNew == false)
            {
                MessageBox.Show("多重起動はできません");
                mutex.Close();
                return;
            }
            try
            {
                UserFiles.SetupUserDirectories();
                Properties.Settings.Default.SoundSource = "Microphone";
                SoundPlayer      soundPlayer = new SoundPlayer();
                Microphone2      microphone  = new Microphone2();
                ApplicationSound appSound    = new ApplicationSound();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new MascotForm(microphone, soundPlayer, appSound));
            }
            finally
            {
                mutex.ReleaseMutex();
                mutex.Close();
            }
        }
Exemple #2
0
 public MascotForm(Microphone2 mic, SoundPlayer sound, ApplicationSound appSound)
 {
     microphone       = mic;
     soundPlayer      = sound;
     applicationSound = appSound;
     InitializeComponent();
     Preprocess();
     Motion();
 }
Exemple #3
0
 public ConfigForm(MascotForm form, Microphone2 mic, ApplicationSound appSound)
 {
     mascotForm       = form;
     microphone       = mic;
     applicationSound = appSound;
     applicationSound.Refresh();
     InitializeComponent();
     InitializeRadioButton();
     SetEvents();
     SetMicrophoneDeviceList();
     SetApplicationSoundNameList("Render");
     SetApplicationSoundNameList("Capture");
     IndicateMicrophoneVolumeLevel();
 }