@@ -126,6 +126,7 @@ public void onServiceDisconnected(ComponentName arg0)
126
126
}
127
127
};
128
128
129
+ @ SuppressLint ("SetTextI18n" )
129
130
private void initUiSetup (boolean fromConnect )
130
131
{
131
132
boolean isPlaying = false ;
@@ -142,7 +143,7 @@ private void initUiSetup(boolean fromConnect)
142
143
Log .d (LOG_TAG , "\" bound\" set to true" );
143
144
isPlaying = m_service .isPlaying ();
144
145
145
- if (isPlaying )
146
+ if (isPlaying )
146
147
{
147
148
Log .d (LOG_TAG , "Player works, make a toast" );
148
149
seekerStart ();
@@ -330,6 +331,31 @@ public void onNothingSelected(AdapterView<?> parent) {
330
331
}
331
332
});
332
333
334
+ /*
335
+ * Channel allocation mode combo-box
336
+ */
337
+ Spinner sChanMode = (Spinner ) findViewById (R .id .channelAllocationMode );
338
+ final String [] chanAllocModeItems = {"[Auto]" , "Releasing delay" , "Released with same instrument" , "Any released" };
339
+
340
+ ArrayAdapter <String > adapterCA = new ArrayAdapter <>(
341
+ this , android .R .layout .simple_spinner_item , chanAllocModeItems );
342
+ adapterCA .setDropDownViewResource (android .R .layout .simple_spinner_dropdown_item );
343
+ sChanMode .setAdapter (adapterCA );
344
+ sChanMode .setSelection (AppSettings .getChanAlocMode ());
345
+
346
+ sChanMode .setOnItemSelectedListener (new AdapterView .OnItemSelectedListener () {
347
+ public void onItemSelected (AdapterView <?> parent ,
348
+ View itemSelected , int selectedItemPosition , long selectedId )
349
+ {
350
+ AppSettings .setChanAllocMode (selectedItemPosition - 1 );
351
+ if (m_bound )
352
+ m_service .setChanAllocMode (selectedItemPosition - 1 );
353
+ }
354
+
355
+ public void onNothingSelected (AdapterView <?> parent ) {
356
+ }
357
+ });
358
+
333
359
334
360
/*
335
361
* Deep Tremolo checkbox
@@ -766,7 +792,7 @@ protected void onStop() {
766
792
public boolean onKeyUp (int keyCode , KeyEvent event ) {
767
793
if (keyCode == KeyEvent .KEYCODE_MENU ) {
768
794
769
- /* **
795
+ /***
770
796
* TODO: Rpleace this crap with properly made settings box
771
797
* (this one can't receive changed value for "input" EditText field)
772
798
*/
@@ -913,6 +939,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
913
939
}
914
940
}
915
941
942
+
916
943
public void OnOpenBankFileClick (View view )
917
944
{
918
945
// Here, thisActivity is the current activity
@@ -932,15 +959,19 @@ public void openBankDialog()
932
959
.setOpenDialogListener (new OpenFileDialog .OpenDialogListener ()
933
960
{
934
961
@ Override
935
- public void OnSelectedFile (Context ctx , String fileName , String lastPath ) {
962
+ public void OnSelectedFile (Context ctx , String fileName , String lastPath )
963
+ {
936
964
m_lastBankPath = fileName ;
937
965
AppSettings .setBankPath (m_lastBankPath );
938
966
939
967
TextView cbl = (TextView ) findViewById (R .id .bankFileName );
940
- if (!m_lastBankPath .isEmpty ()) {
968
+ if (!m_lastBankPath .isEmpty ())
969
+ {
941
970
File f = new File (m_lastBankPath );
942
971
cbl .setText (f .getName ());
943
- } else {
972
+ }
973
+ else
974
+ {
944
975
cbl .setText (R .string .noCustomBankLabel );
945
976
}
946
977
if (m_bound )
@@ -967,13 +998,13 @@ public void openMusicFileDialog()
967
998
.setCurrentDirectory (m_lastPath )
968
999
.setOpenDialogListener (new OpenFileDialog .OpenDialogListener ()
969
1000
{
970
- @ Override
971
- public void OnSelectedDirectory (Context ctx , String lastPath ) {}
972
-
973
1001
@ Override
974
1002
public void OnSelectedFile (Context ctx , String fileName , String lastPath ) {
975
1003
processMusicFile (fileName , lastPath );
976
1004
}
1005
+
1006
+ @ Override
1007
+ public void OnSelectedDirectory (Context ctx , String lastPath ) {}
977
1008
});
978
1009
fileDialog .show ();
979
1010
}
@@ -1133,3 +1164,4 @@ void onGainUpdate(double gainLevel, boolean silent)
1133
1164
gainFactor .setText (String .format (Locale .getDefault (), "%.1f" , gainLevel ));
1134
1165
}
1135
1166
}
1167
+
0 commit comments