summaryrefslogtreecommitdiff
path: root/src/fruits/cmc/cmc.h
blob: b65b336aeab2440fc4738f3941069d815168cfc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once

#include <al/types.h>
#include <al/array.h>
#include <al/str.h>

#include "../../libclient/client.h"
#include "../../portal/src/post_cache.h"
#include "../../codec/codec.h"

#include "ui/ui.h"

struct cmc_search_page {
    u32 num;
    array(str) list;
};

struct cmc_search {
    s32 id;
    str module;
    str query;
    array(struct cmc_search_page *) pages;
};

struct cmc_list_entry {
    u32 id;
    u32 node_id;
    u64 duration;
    u64 start;
    u64 paused_at;
    u64 offset;
    str brief;
    struct {
        struct camu_audio_format fmt;
        u8 *data;
        u32 sample_count;
        char ***drawing;
    } raw;
};

struct cmc_list {
    str name;
    s32 current;
    bool meta_changed;
    array(struct cmc_list_entry *) entries;
};

struct cmc {
    struct {
        u8 command;
        array(str) args;
    } cli;
    struct nn_event_loop loop;
    struct camu_client client;
    array(struct cmc_list *) lists;
    struct camu_post_cache cache;
    array(struct cmc_search *) searches;
    struct cmc_ui ui;
};