Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
file_import.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: © 2023-2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
9
10#ifndef __IO_FILE_IMPORT_H__
11#define __IO_FILE_IMPORT_H__
12
13#include <utility>
14
15#include "dsp/position.h"
16#include "utils/types.h"
17
18// TODO
19#if 0
20
21G_BEGIN_DECLS
22
28
29# define FILE_IMPORT_TYPE (file_import_get_type ())
30G_DECLARE_FINAL_TYPE (FileImport, file_import, Z, FILE_IMPORT, GObject);
31
32struct FileImportInfo
33{
34public:
35 FileImportInfo () = default;
36 FileImportInfo (
37 unsigned int track_name_hash,
38 int lane,
39 Position pos,
40 int track_idx)
41 : track_name_hash_ (track_name_hash), lane_ (lane),
42 pos_ (std::move (pos)), track_idx_ (track_idx)
43 {
44 }
45
47 unsigned int track_name_hash_;
48
50 int lane_;
51
53 Position pos_;
54
56 int track_idx_;
57};
58
62using FileImport = struct _FileImport
63{
64 GObject parent_instance;
65
67 std::string filepath;
68
70 std::vector<std::shared_ptr<Region>> regions;
71
79 GObject * owner;
80
82 std::unique_ptr<FileImportInfo> import_info;
83};
84
85G_END_DECLS
86
90FileImport *
91file_import_new (const std::string &filepath, const FileImportInfo * import_nfo);
92
101void
102file_import_async (
103 FileImport * self,
104 GObject * owner,
105 GCancellable * cancellable,
106 GAsyncReadyCallback callback,
107 gpointer callback_data);
108
109std::vector<std::shared_ptr<Region>>
110file_import_sync (FileImport * self, GError ** error);
111
119std::vector<std::shared_ptr<Region>>
120file_import_finish (FileImport * self, GAsyncResult * result, GError ** error);
121#endif // 0
122
126
127#endif