#pragma once
// The one place a MediaItem* is read for its canonical GUID string and for the
// durable P_LANENAME of the fixed lane it sits on — the item-read analog of
// track_guid's single MediaTrack* -> GUID-key formatter. Extracted from
// near-identical private itemGuid/itemLaneName pairs previously duplicated in
// view.cpp and bank_panel.cpp.
//
// The .cpp includes reaper_plugin_functions.h WITHOUT REAPERAPI_IMPLEMENT
// (main.cpp owns the API pointers). MediaItem/MediaTrack are forward-declared so
// this header stays SDK-lite. These are shell reads; the managed/manual decision
// that consumes the lane name stays pure in lane_keys (isOnManualLane).

#include <string>

class MediaItem;
class MediaTrack;

namespace reasampler {

// An item's canonical GUID string via GetSetMediaItemInfo_String("GUID"). Empty on a
// read failure (an empty GUID must never be tagged — every caller skips empties).
std::string itemGuid(MediaItem* it);

// The durable P_LANENAME of the fixed lane item `it` currently sits on (read via the
// item's I_FIXEDLANE ordinal, then P_LANENAME:n on `tr`). Empty if the lane is unnamed
// or the param is unavailable. Callers must already know `tr` is a fixed-lane track
// (I_FREEMODE==2) before calling — I_FIXEDLANE is meaningless otherwise; the pure
// isOnManualLane predicate handles the non-fixed-lane case via its own argument, so
// callers should not call this at all for a normal track.
std::string itemLaneName(MediaTrack* tr, MediaItem* it);

}  // namespace reasampler
