public PureDataBus GetBus(string busName)
        {
            PureDataBus bus = null;

            try {
                bus = pureData.generalSettings.ApplicationPlaying ? nameBusDict[busName] : System.Array.Find(buses, b => b.Name == busName);
            }
            catch {
                Logger.LogError(string.Format("Bus named {0} was not found.", busName));
            }

            return(bus);
        }
Пример #2
0
        void ShowBuses()
        {
            busesProperty = busManagerSerialized.FindProperty("buses");

            if (AddFoldOut(busesProperty, "Buses".ToGUIContent()))
            {
                busManager.buses[busManager.buses.Length - 1] = new PureDataBus(pureData);
                busManager.buses[busManager.buses.Length - 1].SetUniqueName("default", "", busManager.buses);
                busManager.UpdateMixer();
            }

            if (busesProperty.isExpanded)
            {
                if (busesProperty.arraySize > 0)
                {
                    EditorGUILayout.HelpBox("Be sure to include exactly one [umixer~] object in your main Pure Data patch and to reload it each time you make modifications to the buses.", MessageType.Info);
                }

                EditorGUI.indentLevel += 1;

                for (int i = 0; i < busesProperty.arraySize; i++)
                {
                    currentBus         = busManager.buses[i];
                    currentBusProperty = busesProperty.GetArrayElementAtIndex(i);

                    BeginBox();

                    if (BusDeleteFoldout(i))
                    {
                        busManager.UpdateMixer();
                        break;
                    }

                    ShowBus();

                    EndBox();
                }

                Separator();
                EditorGUI.indentLevel -= 1;
            }
        }
Пример #3
0
		void ShowBuses() {
			busesProperty = busManagerSerialized.FindProperty("buses");
			
			if (AddFoldOut(busesProperty, "Buses".ToGUIContent())) {
				busManager.buses[busManager.buses.Length - 1] = new PureDataBus(pureData);
				busManager.buses[busManager.buses.Length - 1].SetUniqueName("default", "", busManager.buses);
				busManager.UpdateMixer();
			}
			
			if (busesProperty.isExpanded) {
				if (busesProperty.arraySize > 0) {
					EditorGUILayout.HelpBox("Be sure to include exactly one [umixer~] object in your main Pure Data patch and to reload it each time you make modifications to the buses.", MessageType.Info);
				}
				
				EditorGUI.indentLevel += 1;
				
				for (int i = 0; i < busesProperty.arraySize; i++) {
					currentBus = busManager.buses[i];
					currentBusProperty = busesProperty.GetArrayElementAtIndex(i);
					
					BeginBox();
					
					if (BusDeleteFoldout(i)) {
						busManager.UpdateMixer();
						break;
					}
					
					ShowBus();
					
					EndBox();
				}
				
				Separator();
				EditorGUI.indentLevel -= 1;
			}
		}