// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.30.0
// source: player_state.sql

package sqlcgen

import (
	"context"
)

const getPlayerState = `-- name: GetPlayerState :one
SELECT volume, muted, last_track_path, last_position_seconds
FROM player_state WHERE id = 1
`

type GetPlayerStateRow struct {
	Volume              int64
	Muted               bool
	LastTrackPath       string
	LastPositionSeconds int64
}

func (q *Queries) GetPlayerState(ctx context.Context) (GetPlayerStateRow, error) {
	row := q.db.QueryRowContext(ctx, getPlayerState)
	var i GetPlayerStateRow
	err := row.Scan(
		&i.Volume,
		&i.Muted,
		&i.LastTrackPath,
		&i.LastPositionSeconds,
	)
	return i, err
}

const updatePlayerState = `-- name: UpdatePlayerState :exec
UPDATE player_state
SET volume = ?, muted = ?, last_track_path = ?, last_position_seconds = ?
WHERE id = 1
`

type UpdatePlayerStateParams struct {
	Volume              int64
	Muted               bool
	LastTrackPath       string
	LastPositionSeconds int64
}

func (q *Queries) UpdatePlayerState(ctx context.Context, arg UpdatePlayerStateParams) error {
	_, err := q.db.ExecContext(ctx, updatePlayerState,
		arg.Volume,
		arg.Muted,
		arg.LastTrackPath,
		arg.LastPositionSeconds,
	)
	return err
}
