Where's the entry point of the program, and build scripts?

Hello, I would like to get into contributing to Ardour, but it seems almost useless for me to dig through so many definitions in the library without seeing where they are used in execution. Where is the entry point of the program? I can’t do anything until I understand where execution starts. I know that GUIs ‘wait’ for user input, does audio work the same way, ‘waiting’ for an event? I also tried to hit build on the visual studio project provided by the git clone. Not only does it not seem to build Ardour5 but some dependencies don’t seem to be recognized by the IDE. Building is kind of a pain for me in general and I’m not sure the best way to tackle building large open source projects. Should I manually write a build script?

With MSVC you’re mostly your own. There is no active developer using MSVC, nor Windows as development platform (we cross compile for windows).

That being said, I expect getting the build-dependencies compiled will be the harder issue: You may find https://github.com/johne53/ helpful. those are by the same guy who contributed ardour’s MSVC project.

The entry point is ardour_main – however for Ardour/MSVC there is a special case in gtk2_ardour/msvc/winmain.cc.

No, there’s not poll/wait. Some sound APIs do offer that, but ASIO (and other pro-audio APIs) use a callback API. The soundcard’s interrupt directly wakes up the application and calls into it.

Ardour separates this cleanly. The engine (libs/ardour) and audio/MIDI I/O (libs/backends/*) handle realtime processing of the audio. The GUI (gtk2_ardour) is separate. There are also a few other frontends to libardour.

As for the general source-tree layout:

  • libs/pbd is a general purpose library for helper functions
  • libs/canvas a cairo-graphics based drawing canvas, low-level
  • libs/widgets common UI widgets (using cairo)
  • libs/gtkmm2ext some gtkmm library extensions
  • libs/evoral [MIDI] event + automation sequence abstraction
  • libs/backends platform specific Audio/MIDI I/O
  • libs/audiographer mini-Ardour inside Ardour, used for audio-export
  • libs/ardour the audio/midi processing engine etc.
  • gtk2_ardour/ the GUI

Alright so there’s no conventional “main” function defined in the code? Or is there a separate one for both the GUI and the audio I/O? I’m new to open source projects and this code base, but not new to C++. The first thing I was taught was that there needs to be a function called main to call all the rest of the code. Next how would you suggest I go about building larger libraries and projects. This hurdle has come up every time I wanted to work on serious software. There’s so much code dependent on other code and it’s all in separate file paths. The most recent example for me other than Ardour and Audacity is Portaudio itself. It took me months to figure out what wasn’t linking properly.

Should I work on learning CMAKE or…? Building is going to come up again and again for each project I encounter and I need to tackle this fast.

There is a conventional main function int main (int argc, char *argv[]) in gtk2_ardour/main.cc. However, it has been abstracted for various deployment cases.

If I recall correctly, the special casing of msvc/winmain allows output to stdout/stderr when launching Ardour from cmd.exe. It also contains some MSVC specific code that is not relevant elsewhere. John Emmas may correct me, he is the one who wrote it, and to date the only known person using MSVC to compile Ardour.

While I do develop for Windows on occasion, I’ve never used Windows itself to do so, so I cannot answer your other questions.

There is a 4 year old blog about using cygwin: Building Ardour on Windows with MSYS2 – but that’s probably not what you’re looking for.

For my sanity I’m entering Linux. I’m going to try Mint as my first Linux. Any suggestions?

To get started compiling Ardour on GNU/Linux?

https://ardour.org/development.html

# install build-dependencies (debian based distros):
sudo apt-get install build-essential git
sudo apt-get build-dep ardour

# get the Ardour 5.12 source
git clone git://github.com/Ardour/ardour.git
cd ardour
git checkout -b ardour-5.12 5.12

# configure and compile
./waf configure --strict  --ptformat --with-backends=jack,alsa,dummy --optimize --cxx11
./waf

# run from source tree
cd gtk2_ardour
./ardev

Wouldn’t recommend Mint for development. It’s clunky. If you want a debian based system just use vanilla debian.

Rolling distros are less of a headache to maintain though. Arch is easy to manage and set up development environments with. Gentoo is what I consider most ideal for development, but I would not recommend that if this is the first time you’ve tried to use linux.

Great! Yeah Windows has given me a ton of hurdles that really didn’t seem to do with writing C++ on my end, but everything to do with Windows. I guess it isn’t a very beginner friendly platform.