from django.contrib import admin
from .models import Artist, EffectModule, Preset, SignalChainStep, AudioEngineSettings

class SignalChainStepInline(admin.TabularInline):
    model = SignalChainStep
    extra = 3

@admin.register(Artist)
class ArtistAdmin(admin.ModelAdmin):
    list_display = ('name', 'style')
    prepopulated_fields = {'slug': ('name',)}

@admin.register(EffectModule)
class EffectModuleAdmin(admin.ModelAdmin):
    list_display = ('name', 'category')
    list_filter = ('category',)

@admin.register(Preset)
class PresetAdmin(admin.ModelAdmin):
    list_display = ('title', 'artist', 'is_featured')
    list_filter = ('artist', 'is_featured')
    prepopulated_fields = {'slug': ('title',)}
    inlines = [SignalChainStepInline]

@admin.register(AudioEngineSettings)
class AudioEngineSettingsAdmin(admin.ModelAdmin):
    list_display = ('driver_type', 'sample_rate', 'buffer_size')
