コード例 #1
0
		protected internal override void onCreate(Bundle savedInstanceState)
		{
			base.onCreate(savedInstanceState);
			ContentView = R.layout.activity_sapa_simple_piano;

			try
			{
				(new Sapa()).initialize(this);
				mService = new SapaService();
				mService.start(SapaService.START_PARAM_DEFAULT_LATENCY);
				mProcessor = new SapaProcessor(this, null, new StatusListenerAnonymousInnerClassHelper(this));
				mService.register(mProcessor);

				// copy sound font file to sdcard.
				copyAssets();

				mProcessor.sendCommand("START");
				mProcessor.activate();

			}
			catch (SsdkUnsupportedException e)
			{
				Console.WriteLine(e.ToString());
				Console.Write(e.StackTrace);
				Toast.makeText(this, "Not support Professional Audio package", Toast.LENGTH_LONG).show();
				finish();
				return;
			}
			catch (System.ArgumentException e)
			{
				Console.WriteLine(e.ToString());
				Console.Write(e.StackTrace);
				Toast.makeText(this, "Error - invalid arguments. please check the log", Toast.LENGTH_LONG).show();
				finish();
				return;
			}
			catch (InstantiationException e)
			{
				Console.WriteLine(e.ToString());
				Console.Write(e.StackTrace);
				Toast.makeText(this, "Error. please check the log", Toast.LENGTH_LONG).show();
				finish();
				return;
			}

			((Button)findViewById(R.id.play_sound_c1)).OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
		}
コード例 #2
0
        protected internal override void onCreate(Bundle savedInstanceState)
        {
            base.onCreate(savedInstanceState);
            ContentView = R.layout.activity_sapa_simple_piano;

            try
            {
                (new Sapa()).initialize(this);
                mService = new SapaService();
                mService.start(SapaService.START_PARAM_DEFAULT_LATENCY);
                mProcessor = new SapaProcessor(this, null, new StatusListenerAnonymousInnerClassHelper(this));
                mService.register(mProcessor);

                // copy sound font file to sdcard.
                copyAssets();

                mProcessor.sendCommand("START");
                mProcessor.activate();
            }
            catch (SsdkUnsupportedException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
                Toast.makeText(this, "Not support Professional Audio package", Toast.LENGTH_LONG).show();
                finish();
                return;
            }
            catch (System.ArgumentException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
                Toast.makeText(this, "Error - invalid arguments. please check the log", Toast.LENGTH_LONG).show();
                finish();
                return;
            }
            catch (InstantiationException e)
            {
                Console.WriteLine(e.ToString());
                Console.Write(e.StackTrace);
                Toast.makeText(this, "Error. please check the log", Toast.LENGTH_LONG).show();
                finish();
                return;
            }

            ((Button)findViewById(R.id.play_sound_c1)).OnClickListener = new OnClickListenerAnonymousInnerClassHelper(this);
        }
コード例 #3
0
 internal virtual void shush()
 {
     mSapaProcessor.sendCommand(COMMAND_SHUSH);
 }