You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: audio_editor.rs
    path of file: ./repos/UnicornConsole/unicorn-editor/src/ui/audio
    
    the code of the file until where you have to start completion: use std::{iter::Cycle, ops::Range, sync::Arc};

use eframe::egui::Ui;


use unicorn::audio::tracker::chain::ChainId;
use unicorn::audio::sound_rom::Sfx;
use unicorn::audio::consts::SFX_CHANNELS;

use unicorn::sound::sound_engine::{SoundEngine, SoundEngineChannelType, SoundEngineData};
use unicorn::sound::sound_rom_instance::SoundRomInstance;

use crate::editor::editor_sounds_data::EditorSoundData;

use super::{
    AudioEditorHelp, ChainEditor, InstrumentEditor, Oscilloscope, OscilloscopeMode, PhraseEditor,
    SfxEditor, SongEditor,
};

pub struct AudioEditor {
    pub(crate) mode: AudioEditorMode,
    chain_edi
    
    fn push_commands(&mut self, engine: &mut SoundEngine, data: &EditorSoundData) {
        if self.sync_rom {
            self.sync_rom = false;

            let new_instance = Arc::new(SoundRomInstance::from(data));
            self.sound_engine_data
                .replace_sound_rom_instance(&new_instance);
            engine.send(SoundEngineChannelType::SoundRomInstance(new_instance));
        }

        self.command_queue
            .drain(..)
            .for_each(|command| match command {
                AudioSyncCommand::PressedKey {
                    note_index,
                    instrument_index,
                    channel,
                } => engine.send(SoundEngineChannelType::PianoKeyPressed {
                    note_index,
                    instrument_index,
                    channel,
                }),
                AudioSyncCommand::ReleasedKey { channel } => {
                    engine.send(SoundEngineChannelType::PianoKeyReleased { channel })
                }
                AudioSyncCommand::TriggerNote {
                    note_index,
                    instrument_index,
                } => engine.send(SoundEngineChannelType::TriggerNote {
                    note_index,
                    instrument_index,
                    channel: self.channel_ticker.next().unwrap(),
                }),
                AudioSyncCommand::PlayPhrase {
                    phrase_index,
                    target_bpm,
                } => engine.send(SoundEngineChannelType::PlayPhrase {
                    phrase_index,
                    target_bpm,
                }),
                AudioSyncCommand::PlaySfx(sfx) => engine.send(SoundEngineChannelType::PlaySfx(sfx)),
                AudioSyncCommand::StopSfx => engine.send(SoundEngineChannelType::StopSfx),
                AudioSyncCommand::PlayBgm(song) => {
                    engine.send(SoundEngineChannelType::PlayBgm(song))
                }
                AudioSyncCommand::StopBgm => engine.send(SoundEngineChannelType::StopBgm),
            });
    }